Add unique id to entity reg list response (#78945)

* Add unique id to entity reg list response

* Update test_entity_registry.py
This commit is contained in:
Bram Kragten 2022-09-27 08:25:56 +02:00 committed by GitHub
parent fb32e745fc
commit 7e9be812ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -238,6 +238,7 @@ def _entry_dict(entry: er.RegistryEntry) -> dict[str, Any]:
"hidden_by": entry.hidden_by,
"icon": entry.icon,
"id": entry.id,
"unique_id": entry.unique_id,
"name": entry.name,
"original_name": entry.original_name,
"platform": entry.platform,
@ -253,5 +254,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

View File

@ -70,6 +70,7 @@ async def test_list_entities(hass, client):
"hidden_by": None,
"icon": None,
"id": ANY,
"unique_id": ANY,
"name": "Hello World",
"original_name": None,
"platform": "test_platform",
@ -85,6 +86,7 @@ async def test_list_entities(hass, client):
"hidden_by": None,
"icon": None,
"id": ANY,
"unique_id": ANY,
"name": None,
"original_name": None,
"platform": "test_platform",
@ -122,6 +124,7 @@ async def test_list_entities(hass, client):
"hidden_by": None,
"icon": None,
"id": ANY,
"unique_id": ANY,
"name": "Hello World",
"original_name": None,
"platform": "test_platform",