Merge of nested IF-IF cases - H-J (#48368)

This commit is contained in:
Franck Nijhof
2021-03-27 11:30:29 +01:00
committed by GitHub
parent db355f9b23
commit 786023fce4
12 changed files with 81 additions and 78 deletions

View File

@ -281,15 +281,17 @@ class ISYInsteonBinarySensorEntity(ISYBinarySensorEntity):
"""
self._negative_node = child
if self._negative_node.status != ISY_VALUE_UNKNOWN:
# If the negative node has a value, it means the negative node is
# in use for this device. Next we need to check to see if the
# negative and positive nodes disagree on the state (both ON or
# both OFF).
if self._negative_node.status == self._node.status:
# The states disagree, therefore we cannot determine the state
# of the sensor until we receive our first ON event.
self._computed_state = None
# If the negative node has a value, it means the negative node is
# in use for this device. Next we need to check to see if the
# negative and positive nodes disagree on the state (both ON or
# both OFF).
if (
self._negative_node.status != ISY_VALUE_UNKNOWN
and self._negative_node.status == self._node.status
):
# The states disagree, therefore we cannot determine the state
# of the sensor until we receive our first ON event.
self._computed_state = None
def _negative_node_control_handler(self, event: object) -> None:
"""Handle an "On" control event from the "negative" node."""