From 18817f75d3666bc8e84eaab7d350dcf5d105f382 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 16 Mar 2026 00:25:36 -0700 Subject: [PATCH] fix(pm3py): on=False now correctly turns LEDs off instead of on --- pm3py/hw.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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