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:
RyanClark123
2023-05-19 15:14:19 +01:00
parent dc58b19a46
commit 0141f7d01a
5 changed files with 28 additions and 25 deletions
+8 -1
View File
@@ -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: