Add support for proxy-selected intent (#65094)

pull/65142/head
Paulus Schoutsen 2022-01-28 08:16:28 -08:00 committed by GitHub
parent 44572ff354
commit cf6b3fc810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 0 deletions

View File

@ -294,6 +294,15 @@ async def async_devices_reachable(hass, data: RequestData, payload):
}
@HANDLERS.register("action.devices.PROXY_SELECTED")
async def async_devices_proxy_selected(hass, data: RequestData, payload):
"""Handle action.devices.PROXY_SELECTED request.
When selected for local SDK.
"""
return {}
def turned_off_response(message):
"""Return a device turned off response."""
return {

View File

@ -1514,3 +1514,34 @@ async def test_query_recover(hass, caplog):
}
},
}
async def test_proxy_selected(hass, caplog):
"""Test that we handle proxy selected."""
result = await sh.async_handle_message(
hass,
BASIC_CONFIG,
"test-agent",
{
"requestId": REQ_ID,
"inputs": [
{
"intent": "action.devices.PROXY_SELECTED",
"payload": {
"device": {
"id": "abcdefg",
"customData": {},
},
"structureData": {},
},
}
],
},
const.SOURCE_LOCAL,
)
assert result == {
"requestId": REQ_ID,
"payload": {},
}