From a63c4208903ca4dad173fe5bef7246135d980421 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 3 Nov 2023 06:04:07 +0100 Subject: [PATCH] Quote entity ids in entity excpetions (#103286) --- homeassistant/helpers/entity.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/helpers/entity.py b/homeassistant/helpers/entity.py index 1bc8f0b308b..207016aee86 100644 --- a/homeassistant/helpers/entity.py +++ b/homeassistant/helpers/entity.py @@ -989,7 +989,7 @@ class Entity(ABC): """Start adding an entity to a platform.""" if self._platform_state == EntityPlatformState.ADDED: raise HomeAssistantError( - f"Entity {self.entity_id} cannot be added a second time to an entity" + f"Entity '{self.entity_id}' cannot be added a second time to an entity" " platform" ) @@ -1036,7 +1036,7 @@ class Entity(ABC): # EntityComponent and can be removed in HA Core 2024.1 if self.platform and self._platform_state != EntityPlatformState.ADDED: raise HomeAssistantError( - f"Entity {self.entity_id} async_remove called twice" + f"Entity '{self.entity_id}' async_remove called twice" ) self._platform_state = EntityPlatformState.REMOVED @@ -1099,7 +1099,7 @@ class Entity(ABC): # This is an assert as it should never happen, but helps in tests assert ( not self.registry_entry.disabled_by - ), f"Entity {self.entity_id} is being added while it's disabled" + ), f"Entity '{self.entity_id}' is being added while it's disabled" self.async_on_remove( async_track_entity_registry_updated_event(