diff --git a/sma/integrationpluginsma.cpp b/sma/integrationpluginsma.cpp index 19f3e6d2..01eb5bac 100644 --- a/sma/integrationpluginsma.cpp +++ b/sma/integrationpluginsma.cpp @@ -199,6 +199,7 @@ void IntegrationPluginSma::onDevicesReceived(int messageId, QListid()); descriptors.append(descriptor); } diff --git a/sma/integrationpluginsma.h b/sma/integrationpluginsma.h index 76bc0324..523ae9e6 100644 --- a/sma/integrationpluginsma.h +++ b/sma/integrationpluginsma.h @@ -70,7 +70,7 @@ private: QHash m_asyncSetup; SunnyWebBoxCommunication *m_sunnyWebBoxCommunication = nullptr; - SunnyWebBox * createSunnyWebBoxConnection(Thing *thing); + SunnyWebBox *createSunnyWebBoxConnection(Thing *thing); void setupChild(ThingSetupInfo *info, Thing *parentThing); void getData(Thing *thing); }; diff --git a/sma/sunnywebbox.cpp b/sma/sunnywebbox.cpp index 7bd9f3c1..85da7f9b 100644 --- a/sma/sunnywebbox.cpp +++ b/sma/sunnywebbox.cpp @@ -63,17 +63,31 @@ int SunnyWebBox::getProcessDataChannels(const QString &deviceId) int SunnyWebBox::getProcessData(const QStringList &deviceKeys) { - Q_UNUSED(deviceKeys) + QJsonObject params; + params["device"] = deviceKeys.first(); //TODO + return m_communication->sendMessage(m_hostAddresss, "GetProcessData", params); } int SunnyWebBox::getParameterChannels(const QString &deviceKey) { - Q_UNUSED(deviceKey) + QJsonObject paramsObj; + QJsonArray devicesArray; + QJsonObject deviceObj; + deviceObj["key"] = deviceKey; + devicesArray.append(deviceObj); + paramsObj["devices"] = devicesArray; + return m_communication->sendMessage(m_hostAddresss, "GetParameterChannels", paramsObj); } int SunnyWebBox::getParameters(const QStringList &deviceKeys) { - Q_UNUSED(deviceKeys) + QJsonObject paramsObj; + QJsonArray devicesArray; + QJsonObject deviceObj; + deviceObj["key"] = deviceKeys.first(); //TODO + devicesArray.append(deviceObj); + paramsObj["devices"] = devicesArray; + return m_communication->sendMessage(m_hostAddresss, "GetParameter", paramsObj); } int SunnyWebBox::setParameters(const QString &deviceKey, const QHash &channels)