1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Allow binary sensor state to be None (#60193)

This commit is contained in:
Franck Nijhof
2021-12-22 12:24:29 +01:00
committed by GitHub
parent 4805b67300
commit 60b2cdd069
13 changed files with 75 additions and 58 deletions

View File

@@ -8,7 +8,7 @@ from homeassistant.const import STATE_OFF, STATE_ON
def test_state():
"""Test binary sensor state."""
sensor = binary_sensor.BinarySensorEntity()
assert sensor.state == STATE_OFF
assert sensor.state is None
with mock.patch(
"homeassistant.components.binary_sensor.BinarySensorEntity.is_on",
new=False,