Quote entity ids in entity excpetions (#103286)

This commit is contained in:
Erik Montnemery 2023-11-03 06:04:07 +01:00 committed by GitHub
parent 12e1acfcfc
commit a63c420890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(