Fix HomeMatic availability detection (#17341)

* Fix availability detection
This commit is contained in:
Daniel Perna 2018-10-15 20:34:03 +02:00 committed by GitHub
parent 6feacbbfe1
commit 9718a17351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -798,11 +798,8 @@ class HMDevice(Entity):
has_changed = True
# Availability has changed
if attribute == 'UNREACH':
self._available = not bool(value)
has_changed = True
elif not self.available:
self._available = False
if self.available != (not self._hmdevice.UNREACH):
self._available = not self._hmdevice.UNREACH
has_changed = True
# If it has changed data point, update HASS
@ -812,7 +809,6 @@ class HMDevice(Entity):
def _subscribe_homematic_events(self):
"""Subscribe all required events to handle job."""
channels_to_sub = set()
channels_to_sub.add(0) # Add channel 0 for UNREACH
# Push data to channels_to_sub from hmdevice metadata
for metadata in (self._hmdevice.SENSORNODE, self._hmdevice.BINARYNODE,