Allow tradfri to read the available state of the device (#11056)
* Allow tradfri to read the available state of the device * Update tradfri.pypull/11083/head
parent
a4214afddb
commit
7259cc878e
|
@ -160,6 +160,7 @@ class TradfriLight(Light):
|
|||
self._rgb_color = None
|
||||
self._features = SUPPORTED_FEATURES
|
||||
self._temp_supported = False
|
||||
self._available = True
|
||||
|
||||
self._refresh(light)
|
||||
|
||||
|
@ -196,6 +197,11 @@ class TradfriLight(Light):
|
|||
"""Start thread when added to hass."""
|
||||
self._async_start_observe()
|
||||
|
||||
@property
|
||||
def available(self):
|
||||
"""Return True if entity is available."""
|
||||
return self._available
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""No polling needed for tradfri light."""
|
||||
|
@ -299,6 +305,7 @@ class TradfriLight(Light):
|
|||
self._light = light
|
||||
|
||||
# Caching of LightControl and light object
|
||||
self._available = light.reachable
|
||||
self._light_control = light.light_control
|
||||
self._light_data = light.light_control.lights[0]
|
||||
self._name = light.name
|
||||
|
|
Loading…
Reference in New Issue