Reputation: 107
I'm trying to implement an handler for the query request
It's not clear to me what should be returned in case I'm not able to return the status of a device.
In particular I would like to understand how to reply if one of the devices in the query request is no more controlled/owned by the user.
Should I reply with an error response even if only one device of the query request is no more available? Or should I have to report anyway the state of the rest of the devices?
Upvotes: 1
Views: 59
Reputation: 11978
If there is an error in a specific device, you should return an errorCode
as one of the properties in the response for that device. Alternatively, you can return online: false
.
If you know that the device no longer exists, you may want to also run a REQUEST_SYNC
call to refresh the user's devices.
Example:
{
"requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
"payload": {
"devices": {
"123": {
"errorCode": "deviceNotFound"
}
}
}
}
Upvotes: 1