mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Reject nan, inf from generic_thermostat sensor (#48771)
This commit is contained in:
@@ -331,9 +331,18 @@ async def test_sensor_bad_value(hass, setup_comp_2):
|
||||
|
||||
_setup_sensor(hass, None)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
state = hass.states.get(ENTITY)
|
||||
assert temp == state.attributes.get("current_temperature")
|
||||
assert state.attributes.get("current_temperature") == temp
|
||||
|
||||
_setup_sensor(hass, "inf")
|
||||
await hass.async_block_till_done()
|
||||
state = hass.states.get(ENTITY)
|
||||
assert state.attributes.get("current_temperature") == temp
|
||||
|
||||
_setup_sensor(hass, "nan")
|
||||
await hass.async_block_till_done()
|
||||
state = hass.states.get(ENTITY)
|
||||
assert state.attributes.get("current_temperature") == temp
|
||||
|
||||
|
||||
async def test_sensor_unknown(hass):
|
||||
|
||||
Reference in New Issue
Block a user