Cloud Updates (#11404)

* Verify stored keys on startup

* Handle Google Assistant messages

* Fix tests

* Don't verify expiration when getting claims

* Remove email based check

* Lint

* Lint

* Lint
This commit is contained in:
Paulus Schoutsen 2018-01-03 10:16:59 -08:00 committed by Pascal Vizeli
parent 86e1d0f952
commit f314b6cb6c
7 changed files with 178 additions and 108 deletions

View file

@ -5,7 +5,8 @@ import logging
from aiohttp import hdrs, client_exceptions, WSMsgType
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.components.alexa import smart_home
from homeassistant.components.alexa import smart_home as alexa
from homeassistant.components.google_assistant import smart_home as ga
from homeassistant.util.decorator import Registry
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from . import auth_api
@ -204,9 +205,18 @@ def async_handle_message(hass, cloud, handler_name, payload):
@asyncio.coroutine
def async_handle_alexa(hass, cloud, payload):
"""Handle an incoming IoT message for Alexa."""
return (yield from smart_home.async_handle_message(hass,
cloud.alexa_config,
payload))
result = yield from alexa.async_handle_message(hass, cloud.alexa_config,
payload)
return result
@HANDLERS.register('google_assistant')
@asyncio.coroutine
def async_handle_google_assistant(hass, cloud, payload):
"""Handle an incoming IoT message for Google Assistant."""
result = yield from ga.async_handle_message(hass, cloud.gass_config,
payload)
return result
@HANDLERS.register('cloud')