Alexa: run script before generating response text (#2276)

This commit is contained in:
Paulus Schoutsen 2016-06-11 17:57:04 -07:00
parent bc78997bbd
commit f5fc4cd97f

View File

@ -96,6 +96,9 @@ class AlexaView(HomeAssistantView):
card = config.get(CONF_CARD) card = config.get(CONF_CARD)
action = config.get(CONF_ACTION) action = config.get(CONF_ACTION)
if action is not None:
action.run(response.variables)
# pylint: disable=unsubscriptable-object # pylint: disable=unsubscriptable-object
if speech is not None: if speech is not None:
response.add_speech(SpeechType[speech['type']], speech['text']) response.add_speech(SpeechType[speech['type']], speech['text'])
@ -104,9 +107,6 @@ class AlexaView(HomeAssistantView):
response.add_card(CardType[card['type']], card['title'], response.add_card(CardType[card['type']], card['title'],
card['content']) card['content'])
if action is not None:
action.run(response.variables)
return self.json(response) return self.json(response)