fix parsing of params
This commit is contained in:
parent
7a63045999
commit
e4f3c9aba1
@ -345,11 +345,13 @@ JsonReply* DeviceHandler::AddConfiguredDevice(const QVariantMap ¶ms)
|
|||||||
{
|
{
|
||||||
DeviceClassId deviceClass(params.value("deviceClassId").toString());
|
DeviceClassId deviceClass(params.value("deviceClassId").toString());
|
||||||
QList<Param> deviceParams;
|
QList<Param> deviceParams;
|
||||||
foreach (const QString ¶mName, params.value("deviceParams").toMap().keys()) {
|
foreach (const QVariant ¶mVariant, params.value("deviceParams").toList()) {
|
||||||
|
QString paramName = paramVariant.toMap().keys().first();
|
||||||
Param param(paramName);
|
Param param(paramName);
|
||||||
param.setValue(params.value("deviceParams").toMap().value(paramName));
|
param.setValue(paramVariant.toMap().value(paramName));
|
||||||
deviceParams.append(param);
|
deviceParams.append(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceDescriptorId deviceDescriptorId(params.value("deviceDescriptorId").toString());
|
DeviceDescriptorId deviceDescriptorId(params.value("deviceDescriptorId").toString());
|
||||||
DeviceId newDeviceId = DeviceId::createDeviceId();
|
DeviceId newDeviceId = DeviceId::createDeviceId();
|
||||||
QPair<DeviceManager::DeviceError, QString> status;
|
QPair<DeviceManager::DeviceError, QString> status;
|
||||||
|
|||||||
Reference in New Issue
Block a user