Browse Source

fix isAvailable. Returned true at startup, though still no message were received by inverter

pull/1252/head
Wusaweki 2 years ago
parent
commit
291c420aa4
  1. 4
      src/hm/hmInverter.h

4
src/hm/hmInverter.h

@ -391,6 +391,10 @@ class Inverter {
bool isAvailable() { bool isAvailable() {
bool avail = false; bool avail = false;
if (!((recordMeas.ts > 0) || (recordInfo.ts > 0) || (recordConfig.ts > 0) || (recordAlarm.ts > 0)))
return avail;
if((*timestamp - recordMeas.ts) < INVERTER_INACT_THRES_SEC) if((*timestamp - recordMeas.ts) < INVERTER_INACT_THRES_SEC)
avail = true; avail = true;
if((*timestamp - recordInfo.ts) < INVERTER_INACT_THRES_SEC) if((*timestamp - recordInfo.ts) < INVERTER_INACT_THRES_SEC)

Loading…
Cancel
Save