mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
This commit is contained in:
parent
e33451e2b9
commit
7c24d77031
@ -155,9 +155,7 @@ class AlexaResponse(object):
|
|||||||
if 'value' not in resolved:
|
if 'value' not in resolved:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if 'id' in resolved['value']:
|
if 'name' in resolved['value']:
|
||||||
self.variables[underscored_key] = resolved['value']['id']
|
|
||||||
elif 'name' in resolved['value']:
|
|
||||||
self.variables[underscored_key] = resolved['value']['name']
|
self.variables[underscored_key] = resolved['value']['name']
|
||||||
|
|
||||||
def add_card(self, card_type, title, content):
|
def add_card(self, card_type, title, content):
|
||||||
|
@ -208,69 +208,6 @@ def test_intent_request_with_slots(alexa_client):
|
|||||||
assert text == "You told us your sign is virgo."
|
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
|
@asyncio.coroutine
|
||||||
def test_intent_request_with_slots_and_name_resolution(alexa_client):
|
def test_intent_request_with_slots_and_name_resolution(alexa_client):
|
||||||
"""Test a request with slots and a name synonym."""
|
"""Test a request with slots and a name synonym."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user