Przeglądaj źródła

Fix MQTT LED brightness turning off LEDs instead of adjusting

The brightness value was being divided by 100 twice - once in the
MQTT handler and again in the DW LED controller. When HA sent 50%,
it became 0.5% (essentially off).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 4 tygodni temu
rodzic
commit
ed70498adf
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      modules/mqtt/handler.py

+ 2 - 1
modules/mqtt/handler.py

@@ -669,7 +669,8 @@ class MQTTHandler(BaseMQTTHandler):
                 if 0 <= brightness <= 100 and state.led_controller and state.led_provider == "dw_leds":
                     controller = state.led_controller.get_controller()
                     if controller and hasattr(controller, 'set_brightness'):
-                        controller.set_brightness(brightness / 100.0)
+                        # DW LED controller expects 0-100, converts internally to 0.0-1.0
+                        controller.set_brightness(brightness)
                         self.client.publish(f"{self.device_id}/led/brightness/state", brightness, retain=True)
             elif msg.topic == self.led_effect_topic:
                 # Handle LED effect command (DW LEDs only)