1
mirror of https://github.com/home-assistant/core synced 2024-07-24 16:42:06 +02:00

Slightly improve error message in case of duplicate entity IDs (#45424)

This commit is contained in:
Philip Allgaier 2021-01-22 15:16:13 +01:00 committed by GitHub
parent 2bc59c1d8e
commit 89fc92f68a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -102,7 +102,9 @@ async def websocket_update_entity(hass, connection, msg):
if hass.states.get(msg["new_entity_id"]) is not None:
connection.send_message(
websocket_api.error_message(
msg["id"], "invalid_info", "Entity is already registered"
msg["id"],
"invalid_info",
"Entity with this ID is already registered",
)
)
return

View File

@ -388,7 +388,7 @@ class EntityRegistry:
if new_entity_id is not UNDEFINED and new_entity_id != old.entity_id:
if self.async_is_registered(new_entity_id):
raise ValueError("Entity is already registered")
raise ValueError("Entity with this ID is already registered")
if not valid_entity_id(new_entity_id):
raise ValueError("Invalid entity ID")