mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Remove entity category "system" check from entity registry (#116412)
This commit is contained in:
parent
8233b621f0
commit
822646749d
@ -1223,10 +1223,6 @@ class EntityRegistry(BaseRegistry):
|
||||
|
||||
if data is not None:
|
||||
for entity in data["entities"]:
|
||||
# We removed this in 2022.5. Remove this check in 2023.1.
|
||||
if entity["entity_category"] == "system":
|
||||
entity["entity_category"] = None
|
||||
|
||||
try:
|
||||
domain = split_entity_id(entity["entity_id"])[0]
|
||||
_validate_item(
|
||||
|
@ -398,13 +398,6 @@ async def test_filter_on_load(
|
||||
"unique_id": "disabled-hass",
|
||||
"disabled_by": "hass", # We store the string representation
|
||||
},
|
||||
# This entry should have the entity_category reset to None
|
||||
{
|
||||
"entity_id": "test.system_entity",
|
||||
"platform": "super_platform",
|
||||
"unique_id": "system-entity",
|
||||
"entity_category": "system",
|
||||
},
|
||||
]
|
||||
},
|
||||
}
|
||||
@ -412,13 +405,12 @@ async def test_filter_on_load(
|
||||
await er.async_load(hass)
|
||||
registry = er.async_get(hass)
|
||||
|
||||
assert len(registry.entities) == 5
|
||||
assert len(registry.entities) == 4
|
||||
assert set(registry.entities.keys()) == {
|
||||
"test.disabled_hass",
|
||||
"test.disabled_user",
|
||||
"test.named",
|
||||
"test.no_name",
|
||||
"test.system_entity",
|
||||
}
|
||||
|
||||
entry_with_name = registry.async_get_or_create(
|
||||
@ -442,11 +434,6 @@ async def test_filter_on_load(
|
||||
assert entry_disabled_user.disabled
|
||||
assert entry_disabled_user.disabled_by is er.RegistryEntryDisabler.USER
|
||||
|
||||
entry_system_category = registry.async_get_or_create(
|
||||
"test", "system_entity", "system-entity"
|
||||
)
|
||||
assert entry_system_category.entity_category is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize("load_registries", [False])
|
||||
async def test_load_bad_data(
|
||||
|
Loading…
x
Reference in New Issue
Block a user