From 1648dc7769ca24c675b52b3871c071dfb2b2caa7 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sun, 17 Feb 2019 09:39:56 +0100 Subject: [PATCH 1/2] Enable the night mode (scene 6) by calling "go_night" --- miio/philips_moonlight.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/miio/philips_moonlight.py b/miio/philips_moonlight.py index 7cb1aa780..7b1177b74 100644 --- a/miio/philips_moonlight.py +++ b/miio/philips_moonlight.py @@ -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]) From 3dec40a9b41117a09f66fbd01e8dfc839bccf8f3 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sun, 17 Feb 2019 09:44:06 +0100 Subject: [PATCH 2/2] Fix tests --- miio/tests/test_philips_moonlight.py | 1 + 1 file changed, 1 insertion(+) diff --git a/miio/tests/test_philips_moonlight.py b/miio/tests/test_philips_moonlight.py index a2ff3bc8b..5c00510ba 100644 --- a/miio/tests/test_philips_moonlight.py +++ b/miio/tests/test_philips_moonlight.py @@ -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]]),