From 2ce510357d031ffe87dd6d98449c499bc101c284 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Sat, 22 Jun 2024 13:42:20 +0200 Subject: [PATCH] Mark ambilight as not available when off (#120155) --- homeassistant/components/philips_js/light.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/homeassistant/components/philips_js/light.py b/homeassistant/components/philips_js/light.py index d08ecdba8a6a4..8e5005927043c 100644 --- a/homeassistant/components/philips_js/light.py +++ b/homeassistant/components/philips_js/light.py @@ -379,3 +379,12 @@ async def async_turn_off(self, **kwargs: Any) -> None: 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"