1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-27 14:31:13 +00:00

Code styling tweaks to core helpers (#85441)

This commit is contained in:
Franck Nijhof
2023-01-09 00:44:09 +01:00
committed by GitHub
parent cf5fca0464
commit 06a35fb7db
22 changed files with 192 additions and 100 deletions

View File

@@ -303,7 +303,9 @@ class RestoreEntity(Entity):
"""Get data stored for an entity, if any."""
if self.hass is None or self.entity_id is None:
# Return None if this entity isn't added to hass yet
_LOGGER.warning("Cannot get last state. Entity not added to hass") # type: ignore[unreachable]
_LOGGER.warning( # type: ignore[unreachable]
"Cannot get last state. Entity not added to hass"
)
return None
data = await RestoreStateData.async_get_instance(self.hass)
if self.entity_id not in data.last_states: