From 89fc92f68ad75f78084c652fb574255b7d0c9381 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Fri, 22 Jan 2021 15:16:13 +0100 Subject: [PATCH] Slightly improve error message in case of duplicate entity IDs (#45424) --- homeassistant/components/config/entity_registry.py | 4 +++- homeassistant/helpers/entity_registry.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/config/entity_registry.py b/homeassistant/components/config/entity_registry.py index 8d1c488bfa0..f0ee30ca120 100644 --- a/homeassistant/components/config/entity_registry.py +++ b/homeassistant/components/config/entity_registry.py @@ -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 diff --git a/homeassistant/helpers/entity_registry.py b/homeassistant/helpers/entity_registry.py index 95497f7179c..0628c1e0eb5 100644 --- a/homeassistant/helpers/entity_registry.py +++ b/homeassistant/helpers/entity_registry.py @@ -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")