From 153c51114c4ca78595ab870f2abb138d217cc32f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 25 Nov 2021 14:07:42 -0600 Subject: [PATCH] Adjust model names for RGB Symphony (#180) --- flux_led/base_device.py | 6 +++++- flux_led/models_db.py | 6 +++--- tests.py | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/flux_led/base_device.py b/flux_led/base_device.py index db8e54c9..1e903df7 100644 --- a/flux_led/base_device.py +++ b/flux_led/base_device.py @@ -109,6 +109,10 @@ PROTOCOL_LEDENET_ADDRESSABLE_A2, PROTOCOL_LEDENET_ADDRESSABLE_A3, } +SPEED_ADJUST_WILL_TURN_ON = { + PROTOCOL_LEDENET_ADDRESSABLE_A1, + PROTOCOL_LEDENET_ADDRESSABLE_A2, +} class DeviceType(Enum): @@ -140,7 +144,7 @@ def model_num(self) -> int: @property def speed_adjust_off(self) -> int: """Return if the speed of an effect can be adjusted while off.""" - return self.protocol != PROTOCOL_LEDENET_ADDRESSABLE_A1 + return self.protocol not in SPEED_ADJUST_WILL_TURN_ON @property def model(self) -> str: diff --git a/flux_led/models_db.py b/flux_led/models_db.py index b4270d0b..122a05e7 100755 --- a/flux_led/models_db.py +++ b/flux_led/models_db.py @@ -483,7 +483,7 @@ LEDENETModel( model_num=0xA1, models=[], - description="RGB Symphony Original", # https://github.com/Danielhiversen/flux_led/pull/59/files#diff-09e60df19b61f5ceb8d2aef0ade582c2b84979cab660baa27c1ec65725144d76R776 + description="RGB Symphony v1", always_writes_white_and_colors=False, protocol=PROTOCOL_LEDENET_ADDRESSABLE_A1, mode_to_color_mode={}, @@ -494,7 +494,7 @@ LEDENETModel( model_num=0xA2, models=["AK001-ZJ2104"], - description="RGB Symphony 2", + description="RGB Symphony v2", always_writes_white_and_colors=False, protocol=PROTOCOL_LEDENET_ADDRESSABLE_A2, mode_to_color_mode={}, @@ -505,7 +505,7 @@ LEDENETModel( model_num=0xA3, models=["K001-ZJ2148"], - description="RGB Symphony 3", + description="RGB Symphony v3", always_writes_white_and_colors=False, protocol=PROTOCOL_LEDENET_ADDRESSABLE_A3, mode_to_color_mode={}, diff --git a/tests.py b/tests.py index a7afc95b..959bbada 100644 --- a/tests.py +++ b/tests.py @@ -1136,7 +1136,7 @@ def read_data(expected): light = flux_led.WifiLedBulb("192.168.1.164") self.assertEqual(light.model_num, 0xA2) self.assertEqual(light.microphone, True) - self.assertEqual(light.model, "RGB Symphony 2 (0xA2)") + self.assertEqual(light.model, "RGB Symphony v2 (0xA2)") assert len(light.effect_list) == 104 assert light.color_modes == {COLOR_MODE_RGB} @@ -1207,7 +1207,7 @@ def read_data(expected): light = flux_led.WifiLedBulb("192.168.1.164") self.assertEqual(light.model_num, 0xA3) self.assertEqual(light.microphone, True) - self.assertEqual(light.model, "RGB Symphony 3 (0xA3)") + self.assertEqual(light.model, "RGB Symphony v3 (0xA3)") assert len(light.effect_list) == 104 assert light.color_modes == {COLOR_MODE_RGB} @@ -1286,7 +1286,7 @@ def read_data(expected): light = flux_led.WifiLedBulb("192.168.1.164") self.assertEqual(light.dimmable_effects, False) self.assertEqual(light.model_num, 0xA1) - self.assertEqual(light.model, "RGB Symphony Original (0xA1)") + self.assertEqual(light.model, "RGB Symphony v1 (0xA1)") assert len(light.effect_list) == 301 assert light.color_modes == {COLOR_MODE_RGB}