Schrack: Workaround occational random values in Register 507 (min charging current)

pull/76/head
Michael Zanetti 2022-07-28 13:43:24 +02:00
parent 342495b989
commit 84c13bc562
1 changed files with 5 additions and 0 deletions

View File

@ -137,6 +137,11 @@ void IntegrationPluginSchrack::setupThing(ThingSetupInfo *info)
connect(cionConnection, &CionModbusRtuConnection::minChargingCurrentChanged, thing, [=](quint16 minChargingCurrent){
qCDebug(dcSchrack()) << "Minimum charging current changed:" << minChargingCurrent;
if (minChargingCurrent > 32) {
// Apparently this register occationally holds random values... As a quick'n dirty workaround we'll ignore everything > 32
qCWarning(dcSchrack()) << "Detected a bogus min charging current register value (reg. 507) of" << minChargingCurrent << ". Ignoring it...";
return;
}
thing->setStateMinValue(cionMaxChargingCurrentStateTypeId, minChargingCurrent);
});