mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Improve singleton helper typing (#75461)
* Improve singleton helper typing * Fix type errors
This commit is contained in:
@@ -305,9 +305,7 @@ class RestoreEntity(Entity):
|
||||
# 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]
|
||||
return None
|
||||
data = cast(
|
||||
RestoreStateData, await RestoreStateData.async_get_instance(self.hass)
|
||||
)
|
||||
data = await RestoreStateData.async_get_instance(self.hass)
|
||||
if self.entity_id not in data.last_states:
|
||||
return None
|
||||
return data.last_states[self.entity_id]
|
||||
|
||||
Reference in New Issue
Block a user