diff --git a/homeassistant/components/alexa.py b/homeassistant/components/alexa.py index bb9e1816a68..d6178b4744c 100644 --- a/homeassistant/components/alexa.py +++ b/homeassistant/components/alexa.py @@ -8,8 +8,7 @@ import enum import logging from homeassistant.const import HTTP_OK, HTTP_UNPROCESSABLE_ENTITY -from homeassistant.helpers.service import call_from_config -from homeassistant.helpers import template +from homeassistant.helpers import template, script DOMAIN = 'alexa' DEPENDENCIES = ['http'] @@ -91,7 +90,8 @@ def _handle_alexa(handler, path_match, data): card['content']) if action is not None: - call_from_config(handler.server.hass, action, True, response.variables) + script.call_from_config(handler.server.hass, action, + response.variables) handler.write_json(response.as_dict()) diff --git a/homeassistant/helpers/script.py b/homeassistant/helpers/script.py index 0025ddd61df..6c938fd4032 100644 --- a/homeassistant/helpers/script.py +++ b/homeassistant/helpers/script.py @@ -20,9 +20,9 @@ CONF_EVENT_DATA = "event_data" CONF_DELAY = "delay" -def call_from_config(hass, config): +def call_from_config(hass, config, variables=None): """Call a script based on a config entry.""" - Script(hass, config).run() + Script(hass, config).run(variables) class Script():