Browse Source

MI - Fix AC calc after midnight

For other than 1ch inverters
pull/1648/head
rejoe2 11 months ago
committed by GitHub
parent
commit
5f3c6feb35
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 11
      src/hm/Communication.h

11
src/hm/Communication.h

@ -897,7 +897,14 @@ class Communication : public CommQueue<> {
stsok = false;
if( (!oldState) || (!q->iv->alarmCnt) ) { // initial zero value? => just write this channel to main state and raise changed flags
changedStatus = true;
q->iv->alarmCnt = 1; // minimum...
if( !q->iv->alarmCnt ) {
q->iv->alarmCnt = 1; // minimum...
for (uint8_t i = 1; i <= 9; i++) { //start with 1
if (i != stschan && q->iv->lastAlarm[i].code) {
q->iv->lastAlarm[i].code = 0; // zero outdated values
}
}
}
} else {
//sth is or was wrong?
if (q->iv->type == INV_TYPE_1CH) {
@ -996,7 +1003,7 @@ class Communication : public CommQueue<> {
ac_pow += iv->getValue(iv->getPosByChFld(1, FLD_PDC, rec), rec);
} else {
for(uint8_t i = 1; i <= iv->channels; i++) {
if ((!iv->lastAlarm[i].code) || (iv->lastAlarm[i].code == 1))
if ((!iv->lastAlarm[i].code) || (iv->lastAlarm[i].code == 1) || ( (iv->alarmCnt == 1) && (iv->lastAlarm[0].code == 1) ) )
ac_pow += iv->getValue(iv->getPosByChFld(i, FLD_PDC, rec), rec);
}
}

Loading…
Cancel
Save