Ignore empty status update for mqtt number (#94800)
This commit is contained in:
parent
3e71b1daa4
commit
4def901ecc
2 changed files with 11 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue