From 145c98c40c46f9c18c1085332c6f03c80395e0b5 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 11 Jun 2016 17:57:04 -0700 Subject: [PATCH] Alexa: run script before generating response text (#2276) --- homeassistant/components/alexa.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/alexa.py b/homeassistant/components/alexa.py index 2bb155dd322..3a41d51419b 100644 --- a/homeassistant/components/alexa.py +++ b/homeassistant/components/alexa.py @@ -96,6 +96,9 @@ class AlexaView(HomeAssistantView): card = config.get(CONF_CARD) action = config.get(CONF_ACTION) + if action is not None: + action.run(response.variables) + # pylint: disable=unsubscriptable-object if speech is not None: response.add_speech(SpeechType[speech['type']], speech['text']) @@ -104,9 +107,6 @@ class AlexaView(HomeAssistantView): response.add_card(CardType[card['type']], card['title'], card['content']) - if action is not None: - action.run(response.variables) - return self.json(response)