Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions homeassistant/helpers/entity_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,10 @@ async def async_load(self) -> None:
if not valid_entity_id(entity["entity_id"]):
continue

# We removed this in 2022.5. Remove this check in 2023.1.
if entity["entity_category"] == "system":
entity["entity_category"] = None

entities[entity["entity_id"]] = RegistryEntry(
area_id=entity["area_id"],
capabilities=entity["capabilities"],
Expand Down
13 changes: 12 additions & 1 deletion tests/helpers/test_entity_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,20 @@ async def test_loading_extra_values(hass, hass_storage):
"unique_id": "invalid-hass",
"disabled_by": er.RegistryEntryDisabler.HASS,
},
{
"entity_id": "test.system_entity",
"platform": "super_platform",
"unique_id": "system-entity",
"entity_category": "system",
},
]
},
}

await er.async_load(hass)
registry = er.async_get(hass)

assert len(registry.entities) == 4
assert len(registry.entities) == 5

entry_with_name = registry.async_get_or_create(
"test", "super_platform", "with-name"
Expand All @@ -327,6 +333,11 @@ async def test_loading_extra_values(hass, hass_storage):
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


def test_async_get_entity_id(registry):
"""Test that entity_id is returned."""
Expand Down