Fix detection of if a negative node is in use (#11255)

* Fix detection of if a negative node is in use

Fix a problem where every negative node gets detected as in-use. Code was not checking the correct property.

* Allow protected access
pull/11261/head
Greg Laabs 2017-12-20 14:58:22 -08:00 committed by Fabian Affolter
parent e0682044f0
commit b28bfad496
1 changed files with 2 additions and 1 deletions

View File

@ -165,7 +165,8 @@ class ISYBinarySensorDevice(isy.ISYDevice, BinarySensorDevice):
"""
self._negative_node = child
if not _is_val_unknown(self._negative_node):
# pylint: disable=protected-access
if not _is_val_unknown(self._negative_node.status._val):
# If the negative node has a value, it means the negative node is
# in use for this device. Therefore, we cannot determine the state
# of the sensor until we receive our first ON event.