Skip to content

Commit

Permalink
Adjust model names for RGB Symphony (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Nov 25, 2021
1 parent 5fd8795 commit 153c511
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion flux_led/base_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions flux_led/models_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={},
Expand All @@ -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={},
Expand All @@ -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={},
Expand Down
6 changes: 3 additions & 3 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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}

Expand Down Expand Up @@ -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}

Expand Down

0 comments on commit 153c511

Please sign in to comment.