Mark ambilight as not available when off (#120155)

This commit is contained in:
Joakim Plate 2024-06-22 13:42:20 +02:00 committed by GitHub
parent 56d5e41b28
commit 2ce510357d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -379,3 +379,12 @@ class PhilipsTVLightEntity(PhilipsJsEntity, LightEntity):
self._update_from_coordinator()
self.async_write_ha_state()
@property
def available(self) -> bool:
"""Return true if entity is available."""
if not super().available:
return False
if not self.coordinator.api.on:
return False
return self.coordinator.api.powerstate == "On"