fix(pm3py): on=False now correctly turns LEDs off instead of on
This commit is contained in:
@@ -86,8 +86,11 @@ class HWCommands:
|
||||
else:
|
||||
led_mask = self._parse_led_str(led)
|
||||
|
||||
# Resolve action
|
||||
if brightness >= 0:
|
||||
# Resolve action — explicit False means "off"
|
||||
if on is False and not any([off, toggle, pulse, fade, blink, brightness >= 0]):
|
||||
action_code = 0
|
||||
brightness_val = 0
|
||||
elif brightness >= 0:
|
||||
action_code = 3
|
||||
brightness_val = min(max(brightness, 0), 100)
|
||||
elif off:
|
||||
@@ -105,7 +108,7 @@ class HWCommands:
|
||||
elif blink:
|
||||
action_code = 6
|
||||
brightness_val = 0
|
||||
elif on or True: # default to "on"
|
||||
else: # default to "on"
|
||||
action_code = 1
|
||||
brightness_val = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user