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/11470/head
Greg Laabs 2017-12-20 14:58:22 -08:00 committed by Paulus Schoutsen
parent 9055922153
commit 794cfb7976
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.