mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add guard for invalid EntityCategory value (#66316)
This commit is contained in:
@@ -1138,3 +1138,15 @@ async def test_deprecated_entity_category_str(hass, registry, caplog):
|
||||
|
||||
assert entry.entity_category is EntityCategory.DIAGNOSTIC
|
||||
assert " should be updated to use EntityCategory" in caplog.text
|
||||
|
||||
|
||||
async def test_invalid_entity_category_str(hass, registry, caplog):
|
||||
"""Test use of invalid entity category."""
|
||||
entry = er.RegistryEntry(
|
||||
"light",
|
||||
"hue",
|
||||
"5678",
|
||||
entity_category="invalid",
|
||||
)
|
||||
|
||||
assert entry.entity_category is None
|
||||
|
||||
Reference in New Issue
Block a user