Skip to content

Commit

Permalink
[Energy] Fix for New Year's Day (#22536)
Browse files Browse the repository at this point in the history
Fix rollover on New Year's Day
  • Loading branch information
SteWers authored Nov 23, 2024
1 parent fb0666e commit f255233
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ void Energy200ms(void) {
}

bool midnight = (LocalTime() == Midnight());
if ((midnight || RtcTime.day_of_year > Settings->energy_kWhdoy) && TasmotaGlobal.uptime > 10) {
if ((midnight || RtcTime.day_of_year != Settings->energy_kWhdoy) && TasmotaGlobal.uptime > 10) {
Energy->kWhtoday_offset_init = true;
Settings->energy_kWhdoy = RtcTime.day_of_year;

Expand Down
2 changes: 1 addition & 1 deletion tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ void Energy200ms(void) {
}

bool midnight = (LocalTime() == Midnight());
if ((midnight || RtcTime.day_of_year > Energy->Settings.energy_kWhdoy) && TasmotaGlobal.uptime > 10) {
if ((midnight || RtcTime.day_of_year != Energy->Settings.energy_kWhdoy) && TasmotaGlobal.uptime > 10) {
Energy->kWhtoday_offset_init = true;
Energy->Settings.energy_kWhdoy = RtcTime.day_of_year;

Expand Down

0 comments on commit f255233

Please sign in to comment.