Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support music mode for lightstrips #44

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/wyzeapy/services/bulb_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ async def update(self, bulb: Bulb) -> Bulb:
and bulb.type in [DeviceTypes.LIGHTSTRIP, DeviceTypes.MESH_LIGHT]
):
bulb.color = value
elif property_id == PropertyIDs.COLOR_MODE:
bulb.color_mode = value
return bulb

async def get_bulbs(self) -> List[Bulb]:
Expand All @@ -106,8 +108,8 @@ async def turn_on(self, bulb: Bulb, local_control, options=None):
plist = [
create_pid_pair(PropertyIDs.ON, "1")
]
# Put strip back into basic color mode if it isn't already
if bulb.type in [DeviceTypes.LIGHTSTRIP]:
# Put bulb and strip back into basic color mode if it isn't already
if bulb.type in [DeviceTypes.LIGHTSTRIP, DeviceTypes.MESH_LIGHT]:
plist.append(create_pid_pair(PropertyIDs.COLOR_MODE, "1"))

if options is not None:
Expand Down