mirror of
https://github.com/home-assistant/core.git
synced 2026-09-21 10:10:54 -05:00
Guard against missing states in Alexa state updates (#61152)
This commit is contained in:
@@ -117,10 +117,18 @@ async def test_send_add_or_update_message(hass, aioclient_mock):
|
||||
{"friendly_name": "Test Contact Sensor", "device_class": "door"},
|
||||
)
|
||||
|
||||
await state_report.async_send_add_or_update_message(
|
||||
hass, DEFAULT_CONFIG, ["binary_sensor.test_contact", "zwave.bla"]
|
||||
hass.states.async_set(
|
||||
"zwave.bla",
|
||||
"wow_such_unsupported",
|
||||
)
|
||||
|
||||
entities = [
|
||||
"binary_sensor.test_contact",
|
||||
"binary_sensor.non_existing", # Supported, but does not exist
|
||||
"zwave.bla", # Unsupported
|
||||
]
|
||||
await state_report.async_send_add_or_update_message(hass, DEFAULT_CONFIG, entities)
|
||||
|
||||
assert len(aioclient_mock.mock_calls) == 1
|
||||
call = aioclient_mock.mock_calls
|
||||
|
||||
|
||||
Reference in New Issue
Block a user