diff --git a/homeassistant/helpers/entity.py b/homeassistant/helpers/entity.py index 21a704f63be..f94b4257d30 100644 --- a/homeassistant/helpers/entity.py +++ b/homeassistant/helpers/entity.py @@ -230,7 +230,7 @@ class EntityDescription: device_class: str | None = None entity_category: EntityCategory | None = None entity_registry_enabled_default: bool = True - entity_registry_visible_default: bool = False + entity_registry_visible_default: bool = True force_update: bool = False icon: str | None = None name: str | None = None diff --git a/tests/helpers/test_entity.py b/tests/helpers/test_entity.py index 5bd04742195..34cb68403f4 100644 --- a/tests/helpers/test_entity.py +++ b/tests/helpers/test_entity.py @@ -1,6 +1,7 @@ """Test the entity helper.""" # pylint: disable=protected-access import asyncio +import dataclasses from datetime import timedelta import threading from unittest.mock import MagicMock, PropertyMock, patch @@ -932,3 +933,16 @@ def test_entity_category_schema_error(value): match=r"expected EntityCategory or one of 'config', 'diagnostic', 'system'", ): schema(value) + + +async def test_entity_description_fallback(): + """Test entity description has same defaults as entity.""" + ent = entity.Entity() + ent_with_description = entity.Entity() + ent_with_description.entity_description = entity.EntityDescription(key="test") + + for field in dataclasses.fields(entity.EntityDescription): + if field.name == "key": + continue + + assert getattr(ent, field.name) == getattr(ent_with_description, field.name)