mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-06 20:51:38 +02:00
0.7.34
* fix scheduled reboot #1097 * added vector graphic logo `/doc/logo.svg`
This commit is contained in:
parent
439e90dd61
commit
8985b7aff5
2 changed files with 10 additions and 0 deletions
|
@ -281,6 +281,14 @@ void app::updateNtp(void) {
|
|||
uint32_t midTrig = gTimezone.toUTC(localTime - (localTime % 86400) + 86400); // next midnight local time
|
||||
onceAt(std::bind(&app::tickMidnight, this), midTrig, "midNi");
|
||||
}
|
||||
if (mConfig->sys.schedReboot) {
|
||||
uint32_t localTime = gTimezone.toLocal(mTimestamp);
|
||||
uint32_t rebootTrig = gTimezone.toUTC(localTime - (localTime % 86400) + 86410); // reboot 10 secs after midnght
|
||||
if (rebootTrig <= mTimestamp) { //necessary for times other than midnight to prevent reboot loop
|
||||
rebootTrig += 86400;
|
||||
}
|
||||
onceAt(std::bind(&app::tickReboot, this), rebootTrig, "midRe");
|
||||
}
|
||||
}
|
||||
|
||||
if ((mSunrise == 0) && (mConfig->sun.lat) && (mConfig->sun.lon)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue