diff --git a/pm3py/hw.py b/pm3py/hw.py index 374b039..2408bd4 100644 --- a/pm3py/hw.py +++ b/pm3py/hw.py @@ -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