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:
@@ -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"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user