Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion controller/boards/IntelliCenterBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4814,7 +4814,7 @@ class IntelliCenterScheduleCommands extends ScheduleCommands {
if (typeof c === 'undefined') {
let cstate = state.circuits.getInterfaceById(ssched.circuit);
c = { state: cstate, endTime: ssched.scheduleTime.endTime.getTime() };
circs.push;
circs.push(c);
}
if (c.endTime < ssched.scheduleTime.endTime.getTime()) c.endTime = ssched.scheduleTime.endTime.getTime();
}
Expand Down
10 changes: 10 additions & 0 deletions controller/boards/SystemBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3729,6 +3729,16 @@ export class ScheduleCommands extends BoardCommands {
ssched.isOn = schedIsOn;
sys.board.circuits.setEndTime(sys.circuits.getInterfaceById(ssched.circuit), scirc, scirc.isOn, true);
}
else if (schedIsOn && scirc.isOn
&& typeof scirc.endTime !== 'undefined'
&& typeof ssched.scheduleTime.endTime !== 'undefined'
&& ssched.scheduleTime.endTime.getTime() > scirc.endTime.toDate().getTime()) {
// The schedule's window has advanced past the cached circuit endTime
// (e.g. a continuous 24-hour schedule rolling over midnight). Without
// this refresh, checkCircuitEggTimerExpirationAsync would compare
// `now` against the stale endTime and force-turn-off the circuit.
sys.board.circuits.setEndTime(sys.circuits.getInterfaceById(ssched.circuit), scirc, scirc.isOn, true);
}
ssched.emitEquipmentChange();
}
} catch (err) { logger.error(`Error synchronizing schedule states`); }
Expand Down