Add option to disable specific integrations (#16757)

* Add option to disable specific integrations

* Lint
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2018-09-20 23:46:51 +02:00
1 parent 03de658d4d
commit 092c146eae
10 files changed
+222 -28

No files matched your search

+6
View File
@@ -227,6 +227,9 @@ 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."""
if not cloud.alexa_enabled:
return alexa.turned_off_response(payload)
result = yield from alexa.async_handle_message(
hass, cloud.alexa_config, payload)
return result
@@ -236,6 +239,9 @@ def async_handle_alexa(hass, cloud, payload):
@asyncio.coroutine
def async_handle_google_actions(hass, cloud, payload):
"""Handle an incoming IoT message for Google Actions."""
if not cloud.google_enabled:
return ga.turned_off_response(payload)
result = yield from ga.async_handle_message(
hass, cloud.gactions_config, payload)
return result