mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix on state for fibaro light entity (#68914)
This commit is contained in:
parent
2c245fcfec
commit
4ca4180fd2
@ -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."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user