mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +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:
|
if data is not None:
|
||||||
for entity in data["entities"]:
|
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:
|
try:
|
||||||
domain = split_entity_id(entity["entity_id"])[0]
|
domain = split_entity_id(entity["entity_id"])[0]
|
||||||
_validate_item(
|
_validate_item(
|
||||||
|
@ -398,13 +398,6 @@ async def test_filter_on_load(
|
|||||||
"unique_id": "disabled-hass",
|
"unique_id": "disabled-hass",
|
||||||
"disabled_by": "hass", # We store the string representation
|
"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)
|
await er.async_load(hass)
|
||||||
registry = er.async_get(hass)
|
registry = er.async_get(hass)
|
||||||
|
|
||||||
assert len(registry.entities) == 5
|
assert len(registry.entities) == 4
|
||||||
assert set(registry.entities.keys()) == {
|
assert set(registry.entities.keys()) == {
|
||||||
"test.disabled_hass",
|
"test.disabled_hass",
|
||||||
"test.disabled_user",
|
"test.disabled_user",
|
||||||
"test.named",
|
"test.named",
|
||||||
"test.no_name",
|
"test.no_name",
|
||||||
"test.system_entity",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
entry_with_name = registry.async_get_or_create(
|
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
|
||||||
assert entry_disabled_user.disabled_by is er.RegistryEntryDisabler.USER
|
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])
|
@pytest.mark.parametrize("load_registries", [False])
|
||||||
async def test_load_bad_data(
|
async def test_load_bad_data(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user