Improve handling of firmware data fetch

This commit is contained in:
Thomas Basler 2022-08-09 20:12:51 +02:00
parent f566a8c522
commit c3a043b1ce

View File

@ -3,7 +3,6 @@
#include "inverters/HM_2CH.h"
#include "inverters/HM_4CH.h"
#include <Arduino.h>
#include <Every.h>
HoymilesClass Hoymiles;
@ -32,15 +31,12 @@ void HoymilesClass::loop()
// Fetch event log
iv->sendAlarmLogRequest(_radio.get());
// Fetch dev info
if (iv->DevInfo()->getLastUpdate() == 0) {
EVERY_N_MINUTES(10)
{
// Fetch dev info (but first fetch stats)
if (iv->Statistics()->getLastUpdate() > 0 && iv->DevInfo()->getLastUpdate() == 0) {
Serial.println(F("Request device info"));
iv->sendDevInfoRequest(_radio.get());
}
}
}
if (++inverterPos >= getNumInverters()) {
inverterPos = 0;