Refresh token should now work properly
#### Fix * Owlet refresh token becomes invalid after 24 hours. Meant that after 1 day the integration would stop working. Moved to pyowletapi v2023.5.28 which uses different refresh token, should no longer need reconfiguring after 24 hours
This commit is contained in:
@@ -49,9 +49,16 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
if token:
|
||||
hass.config_entries.async_update_entry(entry, data={**entry.data, **token})
|
||||
|
||||
devices = await owlet_api.get_devices(SUPPORTED_VERSIONS)
|
||||
|
||||
if devices["tokens"]:
|
||||
hass.config_entries.async_update_entry(
|
||||
entry, data={**entry.data, **devices["tokens"]}
|
||||
)
|
||||
|
||||
socks = {
|
||||
device["device"]["dsn"]: Sock(owlet_api, device["device"])
|
||||
for device in await owlet_api.get_devices(SUPPORTED_VERSIONS)
|
||||
for device in devices["response"]
|
||||
}
|
||||
|
||||
except OwletAuthenticationError as err:
|
||||
|
||||
Reference in New Issue
Block a user