1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Guard bad entity ID in entity registry (#35271)

This commit is contained in:
Paulus Schoutsen
2020-05-05 15:07:54 -07:00
committed by GitHub
parent 87d58a544b
commit a330eba61c
2 changed files with 14 additions and 0 deletions

View File

@@ -241,12 +241,20 @@ async def test_loading_extra_values(hass, hass_storage):
"unique_id": "disabled-hass",
"disabled_by": "hass",
},
{
"entity_id": "test.invalid__entity",
"platform": "super_platform",
"unique_id": "invalid-hass",
"disabled_by": "hass",
},
]
},
}
registry = await entity_registry.async_get_registry(hass)
assert len(registry.entities) == 4
entry_with_name = registry.async_get_or_create(
"test", "super_platform", "with-name"
)