Skip to content

Commit

Permalink
Philips Moonlight: Support up to 6 fixed scenes (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored Feb 11, 2019
1 parent 6e0a099 commit 02a066c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion miio/philips_moonlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def set_brightness_and_rgb(self, brightness: int, rgb: Tuple[int, int, int]):
)
def set_scene(self, number: int):
"""Set scene number."""
if number < 1 or number > 4:
if number < 1 or number > 6:
raise PhilipsMoonlightException("Invalid fixed scene number: %s" % number)

return self.send("apply_fixed_scene", [number])
6 changes: 3 additions & 3 deletions miio/tests/test_philips_moonlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ def scene():

self.device.set_scene(1)
assert scene() == 1
self.device.set_scene(2)
assert scene() == 2
self.device.set_scene(6)
assert scene() == 6

with pytest.raises(PhilipsMoonlightException):
self.device.set_scene(-1)
Expand All @@ -245,4 +245,4 @@ def scene():
self.device.set_scene(0)

with pytest.raises(PhilipsMoonlightException):
self.device.set_scene(5)
self.device.set_scene(7)

0 comments on commit 02a066c

Please sign in to comment.