From 02a066c6e29a3d11f59270b3a100f0a4209d35bb Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Mon, 11 Feb 2019 20:50:20 +0100 Subject: [PATCH] Philips Moonlight: Support up to 6 fixed scenes (#478) --- miio/philips_moonlight.py | 2 +- miio/tests/test_philips_moonlight.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/miio/philips_moonlight.py b/miio/philips_moonlight.py index 3df222dd7..7cb1aa780 100644 --- a/miio/philips_moonlight.py +++ b/miio/philips_moonlight.py @@ -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]) diff --git a/miio/tests/test_philips_moonlight.py b/miio/tests/test_philips_moonlight.py index 3cd69892e..a2ff3bc8b 100644 --- a/miio/tests/test_philips_moonlight.py +++ b/miio/tests/test_philips_moonlight.py @@ -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) @@ -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)