Skip to content

Commit

Permalink
Merge pull request #48 from bmxpert1/default-empty-store
Browse files Browse the repository at this point in the history
Sets store data to an empty object if store returns it as None
  • Loading branch information
iprak authored Apr 3, 2024
2 parents 67acbdb + 31cc624 commit 409226d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/sensi/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ async def refresh_access_token(

store = storage.Store[dict[str, Any]](hass, STORAGE_VERSION, STORAGE_KEY)
persistent_data = await store.async_load()
if persistent_data is None:
persistent_data = {}

# Data can be missing in older installations, use get()
if refresh_token is None:
Expand Down

0 comments on commit 409226d

Please sign in to comment.