From 7c24d7703180f32f7d19516e8de05de3df82a0e9 Mon Sep 17 00:00:00 2001 From: Kenny Millington Date: Tue, 14 Nov 2017 06:46:26 +0000 Subject: [PATCH] Don't use the 'id' field since it can be autogenerated (fixes #10551). (#10554) --- homeassistant/components/alexa/intent.py | 4 +- tests/components/alexa/test_intent.py | 63 ------------------------ 2 files changed, 1 insertion(+), 66 deletions(-) diff --git a/homeassistant/components/alexa/intent.py b/homeassistant/components/alexa/intent.py index 56887a8a701..c3a0155e312 100644 --- a/homeassistant/components/alexa/intent.py +++ b/homeassistant/components/alexa/intent.py @@ -155,9 +155,7 @@ class AlexaResponse(object): if 'value' not in resolved: continue - if 'id' in resolved['value']: - self.variables[underscored_key] = resolved['value']['id'] - elif 'name' in resolved['value']: + if 'name' in resolved['value']: self.variables[underscored_key] = resolved['value']['name'] def add_card(self, card_type, title, content): diff --git a/tests/components/alexa/test_intent.py b/tests/components/alexa/test_intent.py index 19ecf852622..097c91ded79 100644 --- a/tests/components/alexa/test_intent.py +++ b/tests/components/alexa/test_intent.py @@ -208,69 +208,6 @@ def test_intent_request_with_slots(alexa_client): assert text == "You told us your sign is virgo." -@asyncio.coroutine -def test_intent_request_with_slots_and_id_resolution(alexa_client): - """Test a request with slots and an id synonym.""" - data = { - "version": "1.0", - "session": { - "new": False, - "sessionId": SESSION_ID, - "application": { - "applicationId": APPLICATION_ID - }, - "attributes": { - "supportedHoroscopePeriods": { - "daily": True, - "weekly": False, - "monthly": False - } - }, - "user": { - "userId": "amzn1.account.AM3B00000000000000000000000" - } - }, - "request": { - "type": "IntentRequest", - "requestId": REQUEST_ID, - "timestamp": "2015-05-13T12:34:56Z", - "intent": { - "name": "GetZodiacHoroscopeIntent", - "slots": { - "ZodiacSign": { - "name": "ZodiacSign", - "value": "virgo", - "resolutions": { - "resolutionsPerAuthority": [ - { - "authority": AUTHORITY_ID, - "status": { - "code": "ER_SUCCESS_MATCH" - }, - "values": [ - { - "value": { - "name": "Virgo", - "id": "VIRGO" - } - } - ] - } - ] - } - } - } - } - } - } - req = yield from _intent_req(alexa_client, data) - assert req.status == 200 - data = yield from req.json() - text = data.get("response", {}).get("outputSpeech", - {}).get("text") - assert text == "You told us your sign is VIRGO." - - @asyncio.coroutine def test_intent_request_with_slots_and_name_resolution(alexa_client): """Test a request with slots and a name synonym."""