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

Enable the night mode (scene 6) by calling "go_night" #481

Merged
merged 2 commits into from
Feb 17, 2019
Merged
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
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