mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Improve Alexa error handling (#24745)
This commit is contained in:
@@ -12,7 +12,10 @@ from homeassistant.components.google_assistant import smart_home as ga
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||
from homeassistant.util.aiohttp import MockRequest
|
||||
from homeassistant.components.alexa import smart_home as alexa_sh
|
||||
from homeassistant.components.alexa import (
|
||||
smart_home as alexa_sh,
|
||||
errors as alexa_errors,
|
||||
)
|
||||
|
||||
from . import utils, alexa_config, google_config
|
||||
from .const import DISPATCHER_REMOTE_UPDATE
|
||||
@@ -98,8 +101,14 @@ class CloudClient(Interface):
|
||||
"""Initialize the client."""
|
||||
self.cloud = cloud
|
||||
|
||||
if self.alexa_config.should_report_state and self.cloud.is_logged_in:
|
||||
if (not self.alexa_config.should_report_state or
|
||||
not self.cloud.is_logged_in):
|
||||
return
|
||||
|
||||
try:
|
||||
await self.alexa_config.async_enable_proactive_mode()
|
||||
except alexa_errors.NoTokenAvailable:
|
||||
pass
|
||||
|
||||
async def cleanups(self) -> None:
|
||||
"""Cleanup some stuff after logout."""
|
||||
|
||||
Reference in New Issue
Block a user