mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Ignore empty status update for mqtt number (#94800)
This commit is contained in:
@@ -189,6 +189,14 @@ async def test_value_template(
|
||||
state = hass.states.get("number.test_number")
|
||||
assert state.state == "10"
|
||||
|
||||
# Assert an empty value from a template is ignored
|
||||
async_fire_mqtt_message(hass, topic, '{"other_val":12}')
|
||||
|
||||
await hass.async_block_till_done()
|
||||
|
||||
state = hass.states.get("number.test_number")
|
||||
assert state.state == "10"
|
||||
|
||||
async_fire_mqtt_message(hass, topic, '{"val":20.5}')
|
||||
|
||||
await hass.async_block_till_done()
|
||||
|
||||
Reference in New Issue
Block a user