Skip to content

Commit

Permalink
Mark ambilight as not available when off (home-assistant#120155)
Browse files Browse the repository at this point in the history
  • Loading branch information
elupus authored Jun 22, 2024
1 parent 56d5e41 commit 2ce5103
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions homeassistant/components/philips_js/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 2ce5103

Please sign in to comment.