From 4ca4180fd2497c1fe426680d8d932f4e5e460b8e Mon Sep 17 00:00:00 2001 From: rappenze Date: Wed, 30 Mar 2022 19:41:18 +0200 Subject: [PATCH] Fix on state for fibaro light entity (#68914) --- homeassistant/components/fibaro/light.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/fibaro/light.py b/homeassistant/components/fibaro/light.py index c825bec28c6..4d1c039f137 100644 --- a/homeassistant/components/fibaro/light.py +++ b/homeassistant/components/fibaro/light.py @@ -193,9 +193,23 @@ class FibaroLight(FibaroDevice, LightEntity): self.call_turn_off() @property - def is_on(self): - """Return true if device is on.""" - return self.current_binary_state + def is_on(self) -> bool | None: + """Return true if device is on. + + Dimmable and RGB lights can be on based on different + properties, so we need to check here several values. + """ + props = self.fibaro_device.properties + if self.current_binary_state: + return True + if "brightness" in props and props.brightness != "0": + return True + if "currentProgram" in props and props.currentProgram != "0": + return True + if "currentProgramID" in props and props.currentProgramID != "0": + return True + + return False async def async_update(self): """Update the state."""