Fix person device_trackers null (#31829)

This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2020-02-14 15:27:31 -08:00
1 parent f396f1cb18
commit 52b045ed30
3 files changed
+49 -10

No files matched your search

+5 -1
View File
@@ -158,9 +158,13 @@ class StorageCollection(ObservableCollection):
"""Home Assistant object."""
return self.store.hass
async def _async_load_data(self) -> Optional[dict]:
"""Load the data."""
return cast(Optional[dict], await self.store.async_load())
async def async_load(self) -> None:
"""Load the storage Manager."""
raw_storage = cast(Optional[dict], await self.store.async_load())
raw_storage = await self._async_load_data()
if raw_storage is None:
raw_storage = {"items": []}