Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow binary sensor state to be None #60193

Merged
merged 14 commits into from
Dec 22, 2021
Prev Previous commit
Next Next commit
Fix trend tests
  • Loading branch information
frenck committed Dec 22, 2021
commit 4bfd285a59394909c8c580ad2287da2edd13a2c7
6 changes: 3 additions & 3 deletions tests/components/trend/test_binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from homeassistant import config as hass_config, setup
from homeassistant.components.trend import DOMAIN
from homeassistant.const import SERVICE_RELOAD
from homeassistant.const import SERVICE_RELOAD, STATE_UNKNOWN
import homeassistant.util.dt as dt_util

from tests.common import (
Expand Down Expand Up @@ -307,7 +307,7 @@ def test_non_numeric(self):
self.hass.states.set("sensor.test_state", "Numeric")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_trend_sensor")
assert state.state == "off"
assert state.state == STATE_UNKNOWN

def test_missing_attribute(self):
"""Test attribute down trend."""
Expand All @@ -333,7 +333,7 @@ def test_missing_attribute(self):
self.hass.states.set("sensor.test_state", "State", {"attr": "1"})
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_trend_sensor")
assert state.state == "off"
assert state.state == STATE_UNKNOWN

def test_invalid_name_does_not_create(self):
"""Test invalid name."""
Expand Down