Trying to fix issue

This commit is contained in:
Gunnar Skjold 2024-08-20 20:55:26 +02:00
parent 933926fbb4
commit 159244974d

View File

@ -1367,7 +1367,12 @@ void handleDataSuccess(AmsData* data) {
tmElements_t tm, mtm;
breakTime(now, tm);
breakTime(meterTime, mtm);
if(data->getListType() >= 3) {
if(data->getListType() == 4) { // Assuming these type of meters report all data all the time
if(tm.Minute == 0) {
debugD_P(PSTR("Updating data storage, triggered by list 4 (internal clock %02d:%02d:%02d UTC, neter clock: %02d:%02d:%02d)"), tm.Hour, tm.Minute, tm.Second, mtm.Hour, mtm.Minute, mtm.Second);
saveData = ds.update(data, now);
}
} else if(data->getListType() == 3) { // Assuming HAN-NVE style meters which reports list type 3 only once per hour
if(tm.Minute == 0) {
debugD_P(PSTR("Updating data storage, triggered by internal clock %02d:%02d:%02d UTC (Meter clock: %02d:%02d:%02d)"), tm.Hour, tm.Minute, tm.Second, mtm.Hour, mtm.Minute, mtm.Second);
saveData = ds.update(data, now);