Only report realtime data on MQTT if EnergyAccounting is initialized

This commit is contained in:
Gunnar Skjold
2023-02-27 08:30:56 +01:00
parent cc50457404
commit 4b7160b502
4 changed files with 43 additions and 34 deletions

View File

@@ -26,6 +26,10 @@ void EnergyAccounting::setTimezone(Timezone* tz) {
this->tz = tz;
}
bool EnergyAccounting::isInitialized() {
return this->init;
}
bool EnergyAccounting::update(AmsData* amsData) {
if(config == NULL) return false;
time_t now = time(nullptr);