mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Invert ISY994 dusk/dawn sensors to match expected state (#92035)
This commit is contained in:
parent
2d510bfe0d
commit
969db343bd
@ -400,12 +400,18 @@ class ISYInsteonBinarySensorEntity(ISYBinarySensorEntity):
|
|||||||
Insteon leak sensors set their primary node to On when the state is
|
Insteon leak sensors set their primary node to On when the state is
|
||||||
DRY, not WET, so we invert the binary state if the user indicates
|
DRY, not WET, so we invert the binary state if the user indicates
|
||||||
that it is a moisture sensor.
|
that it is a moisture sensor.
|
||||||
|
|
||||||
|
Dusk/Dawn sensors set their node to On when DUSK, not light detected,
|
||||||
|
so this is inverted as well.
|
||||||
"""
|
"""
|
||||||
if self._computed_state is None:
|
if self._computed_state is None:
|
||||||
# Do this first so we don't invert None on moisture sensors
|
# Do this first so we don't invert None on moisture or light sensors
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if self.device_class == BinarySensorDeviceClass.MOISTURE:
|
if self.device_class in (
|
||||||
|
BinarySensorDeviceClass.LIGHT,
|
||||||
|
BinarySensorDeviceClass.MOISTURE,
|
||||||
|
):
|
||||||
return not self._computed_state
|
return not self._computed_state
|
||||||
|
|
||||||
return self._computed_state
|
return self._computed_state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user