mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-29 08:46:11 +02:00
webserial minor overflow fix #660 web `index.html` improve version information #701 fix MQTT sets power limit to zero (0) #692 changed `reset at midnight` with timezone #697
This commit is contained in:
parent
20864dba57
commit
9ef2df21fa
9 changed files with 28 additions and 15 deletions
|
@ -193,7 +193,8 @@ void app::tickNtpUpdate(void) {
|
|||
if(mConfig->inst.rstValsNotAvail)
|
||||
everyMin(std::bind(&app::tickMinute, this), "tMin");
|
||||
if(mConfig->inst.rstYieldMidNight) {
|
||||
uint32_t midTrig = mTimestamp - ((mTimestamp + MIDNIGHTTICKER_OFFSET) % 86400) + 86400; // next midnight
|
||||
uint32_t localTime = gTimezone.toLocal(mTimestamp);
|
||||
uint32_t midTrig = gTimezone.toUTC(localTime - (localTime % 86400) + 86400); // next midnight local time
|
||||
onceAt(std::bind(&app::tickMidnight, this), midTrig, "midNi");
|
||||
}
|
||||
}
|
||||
|
@ -304,7 +305,8 @@ void app::tickMinute(void) {
|
|||
//-----------------------------------------------------------------------------
|
||||
void app::tickMidnight(void) {
|
||||
// only triggered if 'reset values at midnight is enabled'
|
||||
uint32_t nxtTrig = mTimestamp - ((mTimestamp + MIDNIGHTTICKER_OFFSET) % 86400) + 86400; // next midnight
|
||||
uint32_t localTime = gTimezone.toLocal(mTimestamp);
|
||||
uint32_t nxtTrig = gTimezone.toUTC(localTime - (localTime % 86400) + 86400); // next midnight local time
|
||||
onceAt(std::bind(&app::tickMidnight, this), nxtTrig, "mid2");
|
||||
|
||||
Inverter<> *iv;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue