Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add field "unique_id" to "config/entity_registry/list" websocket response #77476

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion homeassistant/components/config/entity_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def _entry_dict(entry: er.RegistryEntry) -> dict[str, Any]:
"name": entry.name,
"original_name": entry.original_name,
"platform": entry.platform,
"unique_id": entry.unique_id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is added here, it should be removed from _entry_ext_dict below

}


Expand All @@ -252,5 +253,4 @@ def _entry_ext_dict(entry: er.RegistryEntry) -> dict[str, Any]:
data["options"] = entry.options
data["original_device_class"] = entry.original_device_class
data["original_icon"] = entry.original_icon
data["unique_id"] = entry.unique_id
return data
3 changes: 3 additions & 0 deletions tests/components/config/test_entity_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ async def test_list_entities(hass, client):
"name": "Hello World",
"original_name": None,
"platform": "test_platform",
"unique_id": "1234",
},
{
"area_id": None,
Expand All @@ -83,6 +84,7 @@ async def test_list_entities(hass, client):
"name": None,
"original_name": None,
"platform": "test_platform",
"unique_id": "6789",
},
]

Expand Down Expand Up @@ -119,6 +121,7 @@ async def test_list_entities(hass, client):
"name": "Hello World",
"original_name": None,
"platform": "test_platform",
"unique_id": "1234",
},
]

Expand Down