Check Honeywell Lyric token is valid before updating data (#59310)

This commit is contained in:
Aidan Timson 2021-11-14 16:04:04 +00:00 committed by GitHub
parent 46160c2a89
commit 5ec4a502b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,6 +93,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_update_data() -> Lyric:
"""Fetch data from Lyric."""
await oauth_session.async_ensure_token_valid()
try:
async with async_timeout.timeout(60):
await lyric.get_locations()