| | from typing import Literal |
| |
|
| | TimeOfDay = Literal["morning", "afternoon", "evening", "night"] |
| |
|
| | def select_light_scene(time_of_day: str, activity: str) -> str: |
| | """Return a simple lighting scene_id hint from time of day and activity. |
| | |
| | The scene_id is a high-level label, not necessarily the exact dataset row. |
| | """ |
| | t = time_of_day.lower() |
| | a = activity.lower() |
| |
|
| | if "movie" in a: |
| | return "LR_EVENING_MOVIE" |
| | if "gaming" in a or "game" in a: |
| | return "LR_GAME_TIME" |
| | if "work" in a or "deep_work" in a or "office" in a: |
| | return "OF_WORK_FOCUS" |
| | if "cook" in a or "kitchen" in a: |
| | return "KT_COOKING" |
| | if "sleep" in a or "bed" in a or t == "night": |
| | return "BR_NIGHT_SLEEP" |
| | if "coffee" in a or ("relax" in a and t == "morning"): |
| | return "LR_MORNING_SOFT" |
| |
|
| | |
| | if t == "morning": |
| | return "LR_MORNING_SOFT" |
| | if t == "afternoon": |
| | return "OF_WORK_FOCUS" |
| | if t == "evening": |
| | return "LR_EVENING_MOVIE" |
| | return "HW_NIGHT_SAFE" |
| |
|
| |
|
| | if __name__ == "__main__": |
| | tests = [ |
| | ("evening", "watch_movie"), |
| | ("evening", "gaming"), |
| | ("afternoon", "deep_work"), |
| | ("morning", "coffee_relax"), |
| | ("night", "go_to_sleep"), |
| | ] |
| | for t, act in tests: |
| | print(t, act, "->", select_light_scene(t, act)) |
| |
|