mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 23:27:37 +00:00
Quote entity ids in entity excpetions (#103286)
This commit is contained in:
parent
12e1acfcfc
commit
a63c420890
@ -989,7 +989,7 @@ class Entity(ABC):
|
|||||||
"""Start adding an entity to a platform."""
|
"""Start adding an entity to a platform."""
|
||||||
if self._platform_state == EntityPlatformState.ADDED:
|
if self._platform_state == EntityPlatformState.ADDED:
|
||||||
raise HomeAssistantError(
|
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"
|
" platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1036,7 +1036,7 @@ class Entity(ABC):
|
|||||||
# EntityComponent and can be removed in HA Core 2024.1
|
# EntityComponent and can be removed in HA Core 2024.1
|
||||||
if self.platform and self._platform_state != EntityPlatformState.ADDED:
|
if self.platform and self._platform_state != EntityPlatformState.ADDED:
|
||||||
raise HomeAssistantError(
|
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
|
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
|
# This is an assert as it should never happen, but helps in tests
|
||||||
assert (
|
assert (
|
||||||
not self.registry_entry.disabled_by
|
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(
|
self.async_on_remove(
|
||||||
async_track_entity_registry_updated_event(
|
async_track_entity_registry_updated_event(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user