Skip to content

Commit

Permalink
Moonlight: Enable the night mode (scene 6) by calling "go_night" (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored Feb 17, 2019
1 parent 02a066c commit 5567b1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions miio/philips_moonlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,7 @@ def set_scene(self, number: int):
if number < 1 or number > 6:
raise PhilipsMoonlightException("Invalid fixed scene number: %s" % number)

if number == 6:
return self.send("go_night")

return self.send("apply_fixed_scene", [number])
1 change: 1 addition & 0 deletions miio/tests/test_philips_moonlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def __init__(self, *args, **kwargs):
'set_cct': lambda x: self._set_state("cct", x),
'set_rgb': lambda x: self._set_state("rgb", [rgb_to_int(x)]),
'apply_fixed_scene': lambda x: self._set_state("snm", x),
'go_night': lambda x: self._set_state("snm", [6]),
'set_bricct': lambda x: (
self._set_state('bri', [x[0]]),
self._set_state('cct', [x[1]]),
Expand Down

0 comments on commit 5567b1d

Please sign in to comment.