fixed auto device setup
This commit is contained in:
parent
74b33b2d2c
commit
1d2bd72cad
@ -227,6 +227,9 @@ void IntegrationPluginSma::onDevicesReceived(const QString &messageId, QList<Sun
|
|||||||
Q_FOREACH(SunnyWebBox::Device device, devices){
|
Q_FOREACH(SunnyWebBox::Device device, devices){
|
||||||
qCDebug(dcSma()) << " - Device received" << device.name << device.key;
|
qCDebug(dcSma()) << " - Device received" << device.name << device.key;
|
||||||
ThingDescriptor descriptor(inverterThingClassId, device.name, device.key ,thing->id());
|
ThingDescriptor descriptor(inverterThingClassId, device.name, device.key ,thing->id());
|
||||||
|
ParamList params;
|
||||||
|
params << Param(inverterThingIdParamTypeId, device.key);
|
||||||
|
descriptor.setParams(params);
|
||||||
descriptors.append(descriptor);
|
descriptors.append(descriptor);
|
||||||
}
|
}
|
||||||
emit autoThingsAppeared(descriptors);
|
emit autoThingsAppeared(descriptors);
|
||||||
|
|||||||
@ -132,16 +132,19 @@ void SunnyWebBox::parseMessage(const QString &messageId, const QString &messageT
|
|||||||
qCDebug(dcSma()) << "SunnyWebBox: GetPlantOverview";
|
qCDebug(dcSma()) << "SunnyWebBox: GetPlantOverview";
|
||||||
Q_FOREACH(QVariant value, overviewList) {
|
Q_FOREACH(QVariant value, overviewList) {
|
||||||
QVariantMap map = value.toMap();
|
QVariantMap map = value.toMap();
|
||||||
|
|
||||||
if (map["meta"].toString() == "GriPwr") {
|
if (map["meta"].toString() == "GriPwr") {
|
||||||
overview.power = map["value"].toString().toInt();
|
overview.power = map["value"].toString().toInt();
|
||||||
QString unit = map["unit"].toString();
|
QString unit = map["unit"].toString();
|
||||||
qCDebug(dcSma()) << "SunnyWebBox: - Power" << overview.power << unit;
|
qCDebug(dcSma()) << "SunnyWebBox: - Power" << overview.power << unit;
|
||||||
} else if (map["meta"].toString() == "GriEgyTdy") {
|
} else if (map["meta"].toString() == "GriEgyTdy") {
|
||||||
overview.dailyYield = map["value"].toString().toInt();
|
overview.dailyYield = map["value"].toString().toDouble();
|
||||||
qCDebug(dcSma()) << "SunnyWebBox: - Daily yield" << overview.dailyYield;
|
QString unit = map["unit"].toString();
|
||||||
|
qCDebug(dcSma()) << "SunnyWebBox: - Daily yield" << overview.dailyYield << unit;
|
||||||
} else if (map["meta"].toString() == "GriEgyTot") {
|
} else if (map["meta"].toString() == "GriEgyTot") {
|
||||||
overview.totalYield = map["value"].toString().toInt();
|
overview.totalYield = map["value"].toString().toDouble();
|
||||||
qCDebug(dcSma()) << "SunnyWebBox: - Total yield" << overview.totalYield;
|
QString unit = map["unit"].toString();
|
||||||
|
qCDebug(dcSma()) << "SunnyWebBox: - Total yield" << overview.totalYield << unit;
|
||||||
} else if (map["meta"].toString() == "OpStt") {
|
} else if (map["meta"].toString() == "OpStt") {
|
||||||
overview.status = map["value"].toString();
|
overview.status = map["value"].toString();
|
||||||
qCDebug(dcSma()) << "SunnyWebBox: - Status" << overview.status;
|
qCDebug(dcSma()) << "SunnyWebBox: - Status" << overview.status;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user