Skip to content

Commit

Permalink
Merge pull request #167 from testuser7/scenes
Browse files Browse the repository at this point in the history
Update scenes
  • Loading branch information
sbidy committed Jun 5, 2024
2 parents eff3f0d + 8bfb2dd commit 5733af4
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ The discovery works with a UDP Broadcast request and collects all bulbs in the n

## Bulb paramters (UDP RAW)

- **sceneId** - calls one of the predefined scenes (int from 1 to 32) [List of names in code](https://github.com/sbidy/pywizlight/blob/master/pywizlight/scenes.py)
- **sceneId** - calls one of the predefined scenes (int from 1 to 35) [List of names in code](https://github.com/sbidy/pywizlight/blob/master/pywizlight/scenes.py)
- **speed** - sets the color changing speed in percent
- **dimming** - sets the dimmer of the bulb in percent
- **temp** - sets the color temperature in kelvins
Expand Down
2 changes: 1 addition & 1 deletion pywizlight/bulb.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _set_scene(self, scene_id: int) -> None:
"""Set the scene by id."""
if scene_id not in SCENES:
# id not in SCENES !
raise ValueError("Scene is not available. Only 1 to 32 are supported")
raise ValueError("Scene is not available. Only 1 to 35 are supported")
self.pilot_params["sceneId"] = scene_id

def _set_rgbw(self, rgbw: Tuple[int, int, int, int]) -> None:
Expand Down
17 changes: 10 additions & 7 deletions pywizlight/scenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
5: "Fireplace",
6: "Cozy",
7: "Forest",
8: "Pastel Colors",
9: "Wake up",
8: "Pastel colors",
9: "Wake-up",
10: "Bedtime",
11: "Warm White",
11: "Warm white",
12: "Daylight",
13: "Cool white",
14: "Night light",
15: "Focus",
16: "Relax",
17: "True colors",
18: "TV time",
19: "Plantgrowth",
19: "Plant growth",
20: "Spring",
21: "Summer",
22: "Fall",
23: "Deepdive",
23: "Deep dive",
24: "Jungle",
25: "Mojito",
26: "Club",
Expand All @@ -37,11 +37,14 @@
30: "Golden white",
31: "Pulse",
32: "Steampunk",
33: "Diwali",
34: "White",
35: "Alarm",
1000: "Rhythm",
}
SCENE_NAME_TO_ID = {scene_name: scene_id for (scene_id, scene_name) in SCENES.items()}
TW_SCENES = [6, 9, 10, 11, 12, 13, 14, 15, 16, 18, 29, 30, 31, 32]
DW_SCENES = [9, 10, 13, 14, 29, 30, 31, 32]
TW_SCENES = [6, 9, 10, 11, 12, 13, 14, 15, 16, 18, 29, 30, 31, 32, 33, 35]
DW_SCENES = [9, 10, 14, 29, 31, 32, 34, 35]

SCENES_BY_CLASS: Dict[BulbClass, List[str]] = {
BulbClass.RGB: list(cast(Iterable, SCENES.values())),
Expand Down
6 changes: 3 additions & 3 deletions pywizlight/tests/test_bulb_dimmable_white.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ async def test_model_description_dimmable_bulb(dimmable_bulb: wizlight) -> None:
async def test_supported_scenes(dimmable_bulb: wizlight) -> None:
"""Test supported scenes."""
assert await dimmable_bulb.getSupportedScenes() == [
"Wake up",
"Wake-up",
"Bedtime",
"Cool white",
"Night light",
"Candlelight",
"Golden white",
"Pulse",
"Steampunk",
"White",
"Alarm",
]
12 changes: 7 additions & 5 deletions pywizlight/tests/test_bulb_light_strip_1_25_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ async def test_supported_scenes(light_strip: wizlight) -> None:
"Fireplace",
"Cozy",
"Forest",
"Pastel Colors",
"Wake up",
"Pastel colors",
"Wake-up",
"Bedtime",
"Warm White",
"Warm white",
"Daylight",
"Cool white",
"Night light",
"Focus",
"Relax",
"True colors",
"TV time",
"Plantgrowth",
"Plant growth",
"Spring",
"Summer",
"Fall",
"Deepdive",
"Deep dive",
"Jungle",
"Mojito",
"Club",
Expand All @@ -63,6 +63,8 @@ async def test_supported_scenes(light_strip: wizlight) -> None:
"Golden white",
"Pulse",
"Steampunk",
"Diwali",
"Alarm",
"Rhythm",
]

Expand Down
12 changes: 7 additions & 5 deletions pywizlight/tests/test_bulb_rgbw_1_21_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,22 @@ async def test_supported_scenes(rgbw_bulb: wizlight) -> None:
"Fireplace",
"Cozy",
"Forest",
"Pastel Colors",
"Wake up",
"Pastel colors",
"Wake-up",
"Bedtime",
"Warm White",
"Warm white",
"Daylight",
"Cool white",
"Night light",
"Focus",
"Relax",
"True colors",
"TV time",
"Plantgrowth",
"Plant growth",
"Spring",
"Summer",
"Fall",
"Deepdive",
"Deep dive",
"Jungle",
"Mojito",
"Club",
Expand All @@ -72,5 +72,7 @@ async def test_supported_scenes(rgbw_bulb: wizlight) -> None:
"Golden white",
"Pulse",
"Steampunk",
"Diwali",
"Alarm",
"Rhythm",
]
6 changes: 4 additions & 2 deletions pywizlight/tests/test_bulb_turnable_white.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ async def test_supported_scenes(turnable_bulb: wizlight) -> None:
"""Test supported scenes."""
assert await turnable_bulb.getSupportedScenes() == [
"Cozy",
"Wake up",
"Wake-up",
"Bedtime",
"Warm White",
"Warm white",
"Daylight",
"Cool white",
"Night light",
Expand All @@ -54,4 +54,6 @@ async def test_supported_scenes(turnable_bulb: wizlight) -> None:
"Golden white",
"Pulse",
"Steampunk",
"Diwali",
"Alarm",
]

0 comments on commit 5733af4

Please sign in to comment.