mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Add guard in Hue availability check (#64062)
This commit is contained in:
parent
c8043eccc9
commit
ab0d512a5f
@ -142,8 +142,9 @@ class HueBaseEntity(Entity):
|
|||||||
# return if we already processed this entity
|
# return if we already processed this entity
|
||||||
if self._ignore_availability is not None:
|
if self._ignore_availability is not None:
|
||||||
return
|
return
|
||||||
# only do the availability check for entities connected to a device
|
# only do the availability check for entities connected to a device (with `on` feature)
|
||||||
if self.device is None:
|
if self.device is None or not hasattr(self.resource, "on"):
|
||||||
|
self._ignore_availability = False
|
||||||
return
|
return
|
||||||
# ignore availability if user added device to ignore list
|
# ignore availability if user added device to ignore list
|
||||||
if self.device.id in self.bridge.config_entry.options.get(
|
if self.device.id in self.bridge.config_entry.options.get(
|
||||||
@ -190,6 +191,7 @@ class HueBaseEntity(Entity):
|
|||||||
self.device.product_data.model_id,
|
self.device.product_data.model_id,
|
||||||
self.device.product_data.software_version,
|
self.device.product_data.software_version,
|
||||||
)
|
)
|
||||||
# do we want to store this in some persistent storage?
|
# set attribute to false because we only want to log once per light/device.
|
||||||
self._ignore_availability = True
|
# a user must opt-in to ignore availability through integration options
|
||||||
|
self._ignore_availability = False
|
||||||
self._last_state = cur_state
|
self._last_state = cur_state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user