Clean up Alexa smart home code (#24514)

* Clean up Alexa smart home code

* lint

* Lint

* Lint
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2019-06-13 08:43:57 -07:00
1 parent 416ff10ba9
commit 7e2278f1cc
23 files changed
+3132 -2776

No files matched your search

+8 -5
View File
@@ -7,7 +7,10 @@ import aiohttp
from hass_nabucasa.client import CloudClient as Interface
from homeassistant.core import callback
from homeassistant.components.alexa import smart_home as alexa_sh
from homeassistant.components.alexa import (
config as alexa_config,
smart_home as alexa_sh,
)
from homeassistant.components.google_assistant import (
helpers as ga_h, smart_home as ga)
from homeassistant.const import CLOUD_NEVER_EXPOSED_ENTITIES
@@ -28,12 +31,12 @@ class CloudClient(Interface):
def __init__(self, hass: HomeAssistantType, prefs: CloudPreferences,
websession: aiohttp.ClientSession,
alexa_config: Dict[str, Any], google_config: Dict[str, Any]):
alexa_cfg: Dict[str, Any], google_config: Dict[str, Any]):
"""Initialize client interface to Cloud."""
self._hass = hass
self._prefs = prefs
self._websession = websession
self._alexa_user_config = alexa_config
self._alexa_user_config = alexa_cfg
self._google_user_config = google_config
self._alexa_config = None
@@ -75,12 +78,12 @@ class CloudClient(Interface):
return self._prefs.remote_enabled
@property
def alexa_config(self) -> alexa_sh.Config:
def alexa_config(self) -> alexa_config.Config:
"""Return Alexa config."""
if not self._alexa_config:
alexa_conf = self._alexa_user_config
self._alexa_config = alexa_sh.Config(
self._alexa_config = alexa_config.Config(
endpoint=None,
async_get_access_token=None,
should_expose=alexa_conf[CONF_FILTER],