parent
53720c5c48
commit
4e2fcdb9a3
2 changed files with 7 additions and 4 deletions
|
@ -97,12 +97,15 @@ async def async_send_changereport_message(
|
|||
_LOGGER.debug("Sent: %s", json.dumps(message_serialized))
|
||||
_LOGGER.debug("Received (%s): %s", response.status, response_text)
|
||||
|
||||
if response.status == 202 and not invalidate_access_token:
|
||||
if response.status == 202:
|
||||
return
|
||||
|
||||
response_json = json.loads(response_text)
|
||||
|
||||
if response_json["payload"]["code"] == "INVALID_ACCESS_TOKEN_EXCEPTION":
|
||||
if (
|
||||
response_json["payload"]["code"] == "INVALID_ACCESS_TOKEN_EXCEPTION"
|
||||
and not invalidate_access_token
|
||||
):
|
||||
config.async_invalidate_access_token()
|
||||
return await async_send_changereport_message(
|
||||
hass, config, alexa_entity, invalidate_access_token=False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue