From 93dafefd967260af1acf085e623de0abe0bed90b Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Wed, 8 Feb 2023 14:32:46 +0100 Subject: [PATCH] Include entity options in RegistryEntry.as_partial_dict (#87539) --- homeassistant/components/config/entity_registry.py | 1 - homeassistant/helpers/entity_registry.py | 1 + tests/components/config/test_entity_registry.py | 3 +++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/config/entity_registry.py b/homeassistant/components/config/entity_registry.py index 43e433a4f36..0f48c64ae4b 100644 --- a/homeassistant/components/config/entity_registry.py +++ b/homeassistant/components/config/entity_registry.py @@ -266,7 +266,6 @@ def _entry_ext_dict(entry: er.RegistryEntry) -> dict[str, Any]: data["aliases"] = entry.aliases data["capabilities"] = entry.capabilities data["device_class"] = entry.device_class - data["options"] = entry.options data["original_device_class"] = entry.original_device_class data["original_icon"] = entry.original_icon return data diff --git a/homeassistant/helpers/entity_registry.py b/homeassistant/helpers/entity_registry.py index 30bd52cfffc..a9b189fbf89 100644 --- a/homeassistant/helpers/entity_registry.py +++ b/homeassistant/helpers/entity_registry.py @@ -167,6 +167,7 @@ class RegistryEntry: "icon": self.icon, "id": self.id, "name": self.name, + "options": self.options, "original_name": self.original_name, "platform": self.platform, "translation_key": self.translation_key, diff --git a/tests/components/config/test_entity_registry.py b/tests/components/config/test_entity_registry.py index b396f6a6d18..74a471185f9 100644 --- a/tests/components/config/test_entity_registry.py +++ b/tests/components/config/test_entity_registry.py @@ -70,6 +70,7 @@ async def test_list_entities(hass, client): "icon": None, "id": ANY, "name": "Hello World", + "options": {}, "original_name": None, "platform": "test_platform", "translation_key": None, @@ -87,6 +88,7 @@ async def test_list_entities(hass, client): "icon": None, "id": ANY, "name": None, + "options": {}, "original_name": None, "platform": "test_platform", "translation_key": None, @@ -131,6 +133,7 @@ async def test_list_entities(hass, client): "icon": None, "id": ANY, "name": "Hello World", + "options": {}, "original_name": None, "platform": "test_platform", "translation_key": None,