Fix alexa cards (#8708)

This commit is contained in:
Paulus Schoutsen 2017-07-29 21:52:26 -07:00 committed by GitHub
parent 418a8bab11
commit 22088d192a
2 changed files with 16 additions and 7 deletions

View file

@ -171,7 +171,7 @@ class AlexaIntentsView(http.HomeAssistantView):
if 'simple' in intent_response.card:
alexa_response.add_card(
'simple', intent_response.card['simple']['title'],
CardType.simple, intent_response.card['simple']['title'],
intent_response.card['simple']['content'])
return self.json(alexa_response)
@ -208,8 +208,8 @@ class AlexaResponse(object):
self.card = card
return
card["title"] = title.async_render(self.variables)
card["content"] = content.async_render(self.variables)
card["title"] = title
card["content"] = content
self.card = card
def add_speech(self, speech_type, text):
@ -218,9 +218,6 @@ class AlexaResponse(object):
key = 'ssml' if speech_type == SpeechType.ssml else 'text'
if isinstance(text, template.Template):
text = text.async_render(self.variables)
self.speech = {
'type': speech_type.value,
key: text