mirror of
https://github.com/xoseperez/espurna.git
synced 2026-02-20 01:31:34 +01:00
sch: skip next day search w/ valid sunrise or sunset
This commit is contained in:
@@ -1005,24 +1005,26 @@ void update_after(const datetime::Context& ctx) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto next = update(time_point, ctx.utc, CompareAfter{});
|
||||
const auto next = update(time_point, ctx.utc, CompareAfter{});
|
||||
|
||||
event::time_point unordered[] {
|
||||
next,
|
||||
match.rising.next,
|
||||
match.setting.next,
|
||||
};
|
||||
|
||||
if (event::is_valid(match.rising.next)) {
|
||||
DEBUG_MSG_P(PSTR("[SCH] Sunrise at %s\n"),
|
||||
datetime::format_local_tz(match.rising.next).c_str());
|
||||
unordered[0] = event::DefaultTimePoint;
|
||||
}
|
||||
|
||||
if (event::is_valid(match.setting.next)) {
|
||||
DEBUG_MSG_P(PSTR("[SCH] Sunset at %s\n"),
|
||||
datetime::format_local_tz(match.setting.next).c_str());
|
||||
unordered[0] = event::DefaultTimePoint;
|
||||
}
|
||||
|
||||
const event::time_point unordered[] {
|
||||
next,
|
||||
match.rising.next,
|
||||
match.setting.next,
|
||||
};
|
||||
|
||||
next_update = event::DefaultTimePoint;
|
||||
|
||||
for (const auto& value : unordered) {
|
||||
|
||||
Reference in New Issue
Block a user