Add support for proxy-selected intent (#65094)
parent
44572ff354
commit
cf6b3fc810
|
@ -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):
|
def turned_off_response(message):
|
||||||
"""Return a device turned off response."""
|
"""Return a device turned off response."""
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -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": {},
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue