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)