Fix charging and discharging states for storage

master
Simon Stürz 2021-12-10 13:23:06 +01:00
parent f710ce0b44
commit 94dbfaa660
1 changed files with 2 additions and 2 deletions

View File

@ -126,6 +126,6 @@ void FroniusStorage::updateActivityInfo(const QByteArray &data)
QVariantMap dataMap = jsonDoc.toVariant().toMap().value("Body").toMap().value("Data").toMap();
float charge_akku = dataMap.value("Site").toMap().value("P_Akku").toFloat();
pluginThing()->setStateValue(storageCurrentPowerStateTypeId, charge_akku);
pluginThing()->setStateValue(storageChargingStateTypeId, charge_akku < 0);
pluginThing()->setStateValue(storageDischargingStateTypeId, charge_akku > 0);
pluginThing()->setStateValue(storageDischargingStateTypeId, charge_akku < 0);
pluginThing()->setStateValue(storageChargingStateTypeId, charge_akku > 0);
}