add states to device mapp of REST APi
This commit is contained in:
parent
ecf0310e68
commit
3458208857
@ -204,7 +204,13 @@ HttpReply *DevicesResource::getConfiguredDevice(Device *device) const
|
||||
{
|
||||
qCDebug(dcRest) << "Get configured device with id:" << device->id().toString();
|
||||
HttpReply *reply = createSuccessReply();
|
||||
reply->setPayload(QJsonDocument::fromVariant(JsonTypes::packDevice(device)).toJson());
|
||||
QVariantMap deviceMap = JsonTypes::packDevice(device);
|
||||
QVariantList deviceStates = JsonTypes::packDeviceStates(device);
|
||||
deviceMap.insert("states", deviceStates);
|
||||
|
||||
qCDebug(dcRest) << deviceMap;
|
||||
|
||||
reply->setPayload(QJsonDocument::fromVariant(deviceMap).toJson());
|
||||
return reply;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user