Schrack: Ignore bogus CP signal state which happens occationally

master
Michael Zanetti 2023-08-16 16:49:53 +02:00
parent ba922c7e7e
commit b21e60a9c2
1 changed files with 4 additions and 0 deletions

View File

@ -154,6 +154,10 @@ void IntegrationPluginSchrack::setupThing(ThingSetupInfo *info)
connect(cionConnection, &CionModbusRtuConnection::cpSignalStateChanged, thing, [=](quint16 cpSignalState){
qCDebug(dcSchrack()) << "CP Signal state changed:" << (char)cpSignalState;
if (cpSignalState < 65 || cpSignalState > 68) {
qCWarning(dcSchrack()) << "Ignoring bogus CP signal state value" << cpSignalState;
return;
}
thing->setStateValue(cionPluggedInStateTypeId, cpSignalState >= 66);
});