Skip to content

Commit

Permalink
Schedule fetching refresh token (#164)
Browse files Browse the repository at this point in the history
Because MieleOAuth.refresh_token is an async function, it does not
actually run unless something awaits the resulting coroutine that it
returns.
  • Loading branch information
ebroder authored Sep 6, 2023
1 parent c33617a commit f830d8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/miele/miele_at_home.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import functools
import json
import logging
Expand Down Expand Up @@ -174,7 +175,7 @@ def __init__(self, hass, client_id, client_secret, redirect_uri, cache_path=None
)

if self.authorized:
self.refresh_token(hass)
asyncio.create_task(self.refresh_token(hass))

@property
def authorized(self):
Expand Down

0 comments on commit f830d8b

Please sign in to comment.