diff --git a/homeassistant/components/alexa.py b/homeassistant/components/alexa.py index 806d6874a8d..bb9e1816a68 100644 --- a/homeassistant/components/alexa.py +++ b/homeassistant/components/alexa.py @@ -91,7 +91,7 @@ def _handle_alexa(handler, path_match, data): card['content']) if action is not None: - call_from_config(handler.server.hass, action, True) + call_from_config(handler.server.hass, action, True, response.variables) handler.write_json(response.as_dict()) diff --git a/tests/components/test_alexa.py b/tests/components/test_alexa.py index b004ab642ed..03fa5c2d33c 100644 --- a/tests/components/test_alexa.py +++ b/tests/components/test_alexa.py @@ -71,8 +71,8 @@ def setUpModule(): # pylint: disable=invalid-name }, 'action': { 'service': 'test.alexa', - 'data': { - 'hello': 1 + 'data_template': { + 'hello': '{{ ZodiacSign }}' }, 'entity_id': 'switch.test', } @@ -278,6 +278,12 @@ class TestAlexa(unittest.TestCase): 'timestamp': '2015-05-13T12:34:56Z', 'intent': { 'name': 'CallServiceIntent', + 'slots': { + 'ZodiacSign': { + 'name': 'ZodiacSign', + 'value': 'virgo', + } + } } } } @@ -289,7 +295,7 @@ class TestAlexa(unittest.TestCase): self.assertEqual('test', call.domain) self.assertEqual('alexa', call.service) self.assertEqual(['switch.test'], call.data.get('entity_id')) - self.assertEqual(1, call.data.get('hello')) + self.assertEqual('virgo', call.data.get('hello')) def test_session_ended_request(self): """Test the request for ending the session."""