From bc82e5c80daf585eeff6cd03042960dc96d947e4 Mon Sep 17 00:00:00 2001 From: Rob Peters Date: Fri, 31 May 2024 09:05:31 +0200 Subject: [PATCH] Adjusting hourly price before shortlog entry --- main/mainworker.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/main/mainworker.cpp b/main/mainworker.cpp index 2aa3007725..60f15edba2 100644 --- a/main/mainworker.cpp +++ b/main/mainworker.cpp @@ -1698,6 +1698,11 @@ void MainWorker::Do_Work() struct tm ltime; localtime_r(&atime, <ime); + if (ltime.tm_hour != _ScheduleLastHour) + { + HandleHourPrice(); + } + if (ltime.tm_min != _ScheduleLastMinute) { minute_counter++; @@ -1772,14 +1777,6 @@ void MainWorker::Do_Work() HandleAutomaticBackups(); } } - - if ( - (minute_counter % 5 == 0) - || (m_hourPriceElectricity.timestamp == 0) - ) - { - HandleHourPrice(); - } } if (heartbeat_counter++ > 12) {