mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Fix HomeMatic availability detection (#17341)
* Fix availability detection
This commit is contained in:
parent
6feacbbfe1
commit
9718a17351
@ -798,11 +798,8 @@ class HMDevice(Entity):
|
|||||||
has_changed = True
|
has_changed = True
|
||||||
|
|
||||||
# Availability has changed
|
# Availability has changed
|
||||||
if attribute == 'UNREACH':
|
if self.available != (not self._hmdevice.UNREACH):
|
||||||
self._available = not bool(value)
|
self._available = not self._hmdevice.UNREACH
|
||||||
has_changed = True
|
|
||||||
elif not self.available:
|
|
||||||
self._available = False
|
|
||||||
has_changed = True
|
has_changed = True
|
||||||
|
|
||||||
# If it has changed data point, update HASS
|
# If it has changed data point, update HASS
|
||||||
@ -812,7 +809,6 @@ class HMDevice(Entity):
|
|||||||
def _subscribe_homematic_events(self):
|
def _subscribe_homematic_events(self):
|
||||||
"""Subscribe all required events to handle job."""
|
"""Subscribe all required events to handle job."""
|
||||||
channels_to_sub = set()
|
channels_to_sub = set()
|
||||||
channels_to_sub.add(0) # Add channel 0 for UNREACH
|
|
||||||
|
|
||||||
# Push data to channels_to_sub from hmdevice metadata
|
# Push data to channels_to_sub from hmdevice metadata
|
||||||
for metadata in (self._hmdevice.SENSORNODE, self._hmdevice.BINARYNODE,
|
for metadata in (self._hmdevice.SENSORNODE, self._hmdevice.BINARYNODE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user