fix(pm3py): on=False now correctly turns LEDs off instead of on

This commit is contained in:
michael
2026-03-16 00:25:36 -07:00
parent a91d862647
commit 18817f75d3

View File

@@ -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