mirror of https://github.com/arendst/Tasmota.git
[Energy] Fix for New Year's Day (#22536)
Fix rollover on New Year's Day
This commit is contained in:
parent
fb0666e6c8
commit
f255233f90
|
@ -407,7 +407,7 @@ void Energy200ms(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool midnight = (LocalTime() == Midnight());
|
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;
|
Energy->kWhtoday_offset_init = true;
|
||||||
Settings->energy_kWhdoy = RtcTime.day_of_year;
|
Settings->energy_kWhdoy = RtcTime.day_of_year;
|
||||||
|
|
||||||
|
|
|
@ -663,7 +663,7 @@ void Energy200ms(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool midnight = (LocalTime() == Midnight());
|
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->kWhtoday_offset_init = true;
|
||||||
Energy->Settings.energy_kWhdoy = RtcTime.day_of_year;
|
Energy->Settings.energy_kWhdoy = RtcTime.day_of_year;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue