Skip to content

Commit

Permalink
updated fix #879; fix for #1033
Browse files Browse the repository at this point in the history
  • Loading branch information
tagyoureit committed Nov 23, 2024
1 parent a4ec87c commit 1329f3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions controller/State.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1089,8 +1089,9 @@ export class ScheduleStateCollection extends EqStateCollection<ScheduleState> {
let ssched = this.getItemByIndex(i);
let st = ssched.scheduleTime;
let sched = sys.schedules.getItemById(ssched.id);
// rsg st.startTime is null when the schedule has No Days
if (!sched.isActive || ssched.disabled || st.startTime === null) {
// rsg st.startTime is null when the schedule has No Days <-- WRONG. ssched.scheduleDays should be checked.
// original fix #879; updated fix #1033
if (!sched.isActive || ssched.disabled || ssched.scheduleDays === 0) {
continue;
}
st.calcSchedule(state.time, sys.schedules.getItemById(ssched.id));
Expand Down
2 changes: 1 addition & 1 deletion controller/boards/SystemBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3631,7 +3631,7 @@ export class ScheduleCommands extends BoardCommands {
if (heatSetpoint < 0 || heatSetpoint > 104) return Promise.reject(new InvalidEquipmentDataError(`Invalid heat setpoint: ${heatSetpoint}`, 'Schedule', heatSetpoint));
if (sys.board.circuits.getCircuitReferences(true, true, false, true).find(elem => elem.id === circuit) === undefined)
return Promise.reject(new InvalidEquipmentDataError(`Invalid circuit reference: ${circuit}`, 'Schedule', circuit));
if (schedType === 128 && schedDays === 0) return Promise.reject(new InvalidEquipmentDataError(`Invalid schedule days: ${schedDays}. You must supply days that the schedule is to run.`, 'Schedule', schedDays));
if (schedType === 128 && schedDays === 0) return Promise.reject(new InvalidEquipmentDataError(`Invalid schedule days: ${schedDays}. You must supply days that the schedule is to run.`, 'Schedule', schedDays)); // rsg 2024.11.22 - some controllers allow no days.

// If we made it to here we are valid and the schedula and it state should exist.
sched = sys.schedules.getItemById(id, true);
Expand Down

0 comments on commit 1329f3c

Please sign in to comment.