Guard against missing states in Alexa state updates (#61152)

This commit is contained in:
Erik Montnemery
2021-12-07 12:44:50 +01:00
committed by GitHub
parent 4563d95d40
commit af2e95d891
2 changed files with 15 additions and 6 deletions
+10 -2
View File
@@ -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