Skip to content

Commit

Permalink
Add new scene
Browse files Browse the repository at this point in the history
  • Loading branch information
testuser7 committed Oct 9, 2023
1 parent 92613b0 commit 8bfb2dd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 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:
Expand Down
3 changes: 2 additions & 1 deletion pywizlight/scenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())),
Expand Down
2 changes: 1 addition & 1 deletion pywizlight/tests/test_bulb_dimmable_white.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

0 comments on commit 8bfb2dd

Please sign in to comment.