mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Constrain SimpliSafe's check for emergency token usage (#31214)
This commit is contained in:
parent
4e2737bfb7
commit
f95a072877
@ -316,7 +316,6 @@ class SimpliSafe:
|
||||
"""Update a system."""
|
||||
try:
|
||||
await system.update()
|
||||
latest_event = await system.get_latest_event()
|
||||
except InvalidCredentialsError:
|
||||
# SimpliSafe's cloud is a little shaky. At times, a 500 or 502 will
|
||||
# seemingly harm simplisafe-python's existing access token _and_ refresh
|
||||
@ -338,7 +337,9 @@ class SimpliSafe:
|
||||
|
||||
_LOGGER.warning("SimpliSafe cloud error; trying stored refresh token")
|
||||
self._emergency_refresh_token_used = True
|
||||
await self._api.refresh_access_token(self._config_entry.data[CONF_TOKEN])
|
||||
return await self._api.refresh_access_token(
|
||||
self._config_entry.data[CONF_TOKEN]
|
||||
)
|
||||
except SimplipyError as err:
|
||||
_LOGGER.error(
|
||||
'SimpliSafe error while updating "%s": %s', system.address, err
|
||||
@ -348,7 +349,7 @@ class SimpliSafe:
|
||||
_LOGGER.error('Unknown error while updating "%s": %s', system.address, err)
|
||||
return
|
||||
|
||||
self.last_event_data[system.system_id] = latest_event
|
||||
self.last_event_data[system.system_id] = await system.get_latest_event()
|
||||
|
||||
# If we've reached this point using an emergency refresh token, we're in the
|
||||
# clear and we can discard it:
|
||||
|
@ -3,7 +3,7 @@
|
||||
"name": "SimpliSafe",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/simplisafe",
|
||||
"requirements": ["simplisafe-python==6.0.0"],
|
||||
"requirements": ["simplisafe-python==6.1.0"],
|
||||
"dependencies": [],
|
||||
"codeowners": ["@bachya"]
|
||||
}
|
||||
|
@ -1816,7 +1816,7 @@ simplehound==0.3
|
||||
simplepush==1.1.4
|
||||
|
||||
# homeassistant.components.simplisafe
|
||||
simplisafe-python==6.0.0
|
||||
simplisafe-python==6.1.0
|
||||
|
||||
# homeassistant.components.sisyphus
|
||||
sisyphus-control==2.2.1
|
||||
|
@ -591,7 +591,7 @@ sentry-sdk==0.13.5
|
||||
simplehound==0.3
|
||||
|
||||
# homeassistant.components.simplisafe
|
||||
simplisafe-python==6.0.0
|
||||
simplisafe-python==6.1.0
|
||||
|
||||
# homeassistant.components.sleepiq
|
||||
sleepyq==0.7
|
||||
|
Loading…
x
Reference in New Issue
Block a user