From 68779134eba6f2e43a3de9922e3b95647f8ce893 Mon Sep 17 00:00:00 2001 From: testuser7 Date: Sat, 30 Sep 2023 15:24:19 +0200 Subject: [PATCH 1/4] Update scenes --- pywizlight/scenes.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pywizlight/scenes.py b/pywizlight/scenes.py index 6c2fe4b..8a66d36 100755 --- a/pywizlight/scenes.py +++ b/pywizlight/scenes.py @@ -12,10 +12,10 @@ 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", @@ -23,11 +23,11 @@ 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", @@ -37,11 +37,13 @@ 30: "Golden white", 31: "Pulse", 32: "Steampunk", + 33: "Diwali", + 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, 13, 14, 29, 31, 32, 35] SCENES_BY_CLASS: Dict[BulbClass, List[str]] = { BulbClass.RGB: list(cast(Iterable, SCENES.values())), From dabc2a5f34ad2cd3cc10fdaec72bd6dfaf444c6f Mon Sep 17 00:00:00 2001 From: testuser7 Date: Sat, 30 Sep 2023 16:17:28 +0200 Subject: [PATCH 2/4] Update tests --- pywizlight/scenes.py | 2 +- pywizlight/tests/test_bulb_dimmable_white.py | 6 +++--- pywizlight/tests/test_bulb_light_strip_1_25_0.py | 12 +++++++----- pywizlight/tests/test_bulb_rgbw_1_21_4.py | 12 +++++++----- pywizlight/tests/test_bulb_turnable_white.py | 6 ++++-- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/pywizlight/scenes.py b/pywizlight/scenes.py index 8a66d36..0a507d5 100755 --- a/pywizlight/scenes.py +++ b/pywizlight/scenes.py @@ -43,7 +43,7 @@ } 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, 33, 35] -DW_SCENES = [9, 10, 13, 14, 29, 31, 32, 35] +DW_SCENES = [9, 10, 11, 14, 29, 31, 32, 35] SCENES_BY_CLASS: Dict[BulbClass, List[str]] = { BulbClass.RGB: list(cast(Iterable, SCENES.values())), diff --git a/pywizlight/tests/test_bulb_dimmable_white.py b/pywizlight/tests/test_bulb_dimmable_white.py index 891293f..e196f09 100644 --- a/pywizlight/tests/test_bulb_dimmable_white.py +++ b/pywizlight/tests/test_bulb_dimmable_white.py @@ -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", + "Warm white", "Night light", "Candlelight", - "Golden white", "Pulse", "Steampunk", + "Alarm", ] diff --git a/pywizlight/tests/test_bulb_light_strip_1_25_0.py b/pywizlight/tests/test_bulb_light_strip_1_25_0.py index 61efd91..a519d68 100644 --- a/pywizlight/tests/test_bulb_light_strip_1_25_0.py +++ b/pywizlight/tests/test_bulb_light_strip_1_25_0.py @@ -38,10 +38,10 @@ 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", @@ -49,11 +49,11 @@ async def test_supported_scenes(light_strip: wizlight) -> None: "Relax", "True colors", "TV time", - "Plantgrowth", + "Plant growth", "Spring", "Summer", "Fall", - "Deepdive", + "Deep dive", "Jungle", "Mojito", "Club", @@ -63,6 +63,8 @@ async def test_supported_scenes(light_strip: wizlight) -> None: "Golden white", "Pulse", "Steampunk", + "Diwali", + "Alarm", "Rhythm", ] diff --git a/pywizlight/tests/test_bulb_rgbw_1_21_4.py b/pywizlight/tests/test_bulb_rgbw_1_21_4.py index 2fced71..72a1a3c 100644 --- a/pywizlight/tests/test_bulb_rgbw_1_21_4.py +++ b/pywizlight/tests/test_bulb_rgbw_1_21_4.py @@ -47,10 +47,10 @@ 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", @@ -58,11 +58,11 @@ async def test_supported_scenes(rgbw_bulb: wizlight) -> None: "Relax", "True colors", "TV time", - "Plantgrowth", + "Plant growth", "Spring", "Summer", "Fall", - "Deepdive", + "Deep dive", "Jungle", "Mojito", "Club", @@ -72,5 +72,7 @@ async def test_supported_scenes(rgbw_bulb: wizlight) -> None: "Golden white", "Pulse", "Steampunk", + "Diwali", + "Alarm", "Rhythm", ] diff --git a/pywizlight/tests/test_bulb_turnable_white.py b/pywizlight/tests/test_bulb_turnable_white.py index 77dd6eb..3ed2ebb 100644 --- a/pywizlight/tests/test_bulb_turnable_white.py +++ b/pywizlight/tests/test_bulb_turnable_white.py @@ -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", @@ -54,4 +54,6 @@ async def test_supported_scenes(turnable_bulb: wizlight) -> None: "Golden white", "Pulse", "Steampunk", + "Diwali", + "Alarm", ] From 92613b0bc05dfc1eedccb11ea84071a103060fdb Mon Sep 17 00:00:00 2001 From: testuser7 Date: Sat, 30 Sep 2023 16:26:22 +0200 Subject: [PATCH 3/4] Update readme --- README.md | 2 +- pywizlight/bulb.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 01d99d5..467232d 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,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 33, 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 diff --git a/pywizlight/bulb.py b/pywizlight/bulb.py index f1f2f4c..bcc4405 100755 --- a/pywizlight/bulb.py +++ b/pywizlight/bulb.py @@ -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 33, 35 are supported") self.pilot_params["sceneId"] = scene_id def _set_rgbw(self, rgbw: Tuple[int, int, int, int]) -> None: From 8bfb2dd05991869f6005b34516d0cb4e94c2612f Mon Sep 17 00:00:00 2001 From: testuser7 Date: Mon, 9 Oct 2023 18:15:17 +0200 Subject: [PATCH 4/4] Add new scene --- README.md | 2 +- pywizlight/bulb.py | 2 +- pywizlight/scenes.py | 3 ++- pywizlight/tests/test_bulb_dimmable_white.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 467232d..bffcc68 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,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 33, 35) [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 diff --git a/pywizlight/bulb.py b/pywizlight/bulb.py index bcc4405..7260a3d 100755 --- a/pywizlight/bulb.py +++ b/pywizlight/bulb.py @@ -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 33, 35 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: diff --git a/pywizlight/scenes.py b/pywizlight/scenes.py index 0a507d5..db3f5c0 100755 --- a/pywizlight/scenes.py +++ b/pywizlight/scenes.py @@ -38,12 +38,13 @@ 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, 33, 35] -DW_SCENES = [9, 10, 11, 14, 29, 31, 32, 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())), diff --git a/pywizlight/tests/test_bulb_dimmable_white.py b/pywizlight/tests/test_bulb_dimmable_white.py index e196f09..922341c 100644 --- a/pywizlight/tests/test_bulb_dimmable_white.py +++ b/pywizlight/tests/test_bulb_dimmable_white.py @@ -42,10 +42,10 @@ async def test_supported_scenes(dimmable_bulb: wizlight) -> None: assert await dimmable_bulb.getSupportedScenes() == [ "Wake-up", "Bedtime", - "Warm white", "Night light", "Candlelight", "Pulse", "Steampunk", + "White", "Alarm", ]