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

Fixes #9 #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion jellyfishlightspy/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def apply_light_string(self, light_string: List[Tuple[int, int, int]], brightnes
colors.extend(rgb)
colors_pos.append(i)
config = PatternConfig(type="Soffit", colors=colors, colorPos=colors_pos, runData=RunConfig(brightness=brightness))
self.__send(SetZoneStateRequest(state=3, zoneName=zones, data=config))
self.__send(SetZoneStateRequest(state=1, zoneName=zones, data=config))
if sync and not self.__cache.zone_state_data.await_update(timeout, zones):
raise JellyFishException(f"Request to apply light string on zones {zones} timed out")
except JellyFishException:
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_set_run_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def test_apply_light_string(controller):
zone = controller.zone_names[0]
controller.apply_light_string([(255, 255, 255), (255, 0, 0), (0, 255, 0) ,(0, 0, 255)], 55, [zone])
state = controller.get_zone_state(zone)
assert state.is_on and state.state in [-1, 3]
assert state.is_on and state.state == 1
assert state.data.colors == [0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 255, 0, 0, 0, 255]
assert state.data.runData.brightness == 55
controller.turn_off([zone])
controller.apply_light_string([(50, 50, 50)], 66)
for zone, state in controller.get_zone_states().items():
assert state.is_on and state.state in [-1, 3]
assert state.is_on and state.state == 1
assert state.data.colors == [0, 0, 0, 50, 50, 50]
assert state.data.runData.brightness == 66

Expand Down