Browse Source

add dimmer scheduler support to firmware

rfm69
wysiwyng 7 years ago
parent
commit
54fc15c059
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      code/espurna/scheduler.ino

+ 10
- 4
code/espurna/scheduler.ino View File

@ -120,11 +120,17 @@ void _schCheck() {
int minutes_to_trigger = _schMinutesLeft(sch_hour, sch_minute); int minutes_to_trigger = _schMinutesLeft(sch_hour, sch_minute);
if (minutes_to_trigger == 0) { if (minutes_to_trigger == 0) {
int sch_action = getSetting("schAction", i, 0).toInt(); int sch_brightness = getSetting("schBrightness", i, -1).toInt();
if (sch_action == 2) { if (sch_brightness > -1) {
relayToggle(sch_switch); lightChannel(sch_switch, sch_brightness);
lightUpdate(true, true);
} else { } else {
relayStatus(sch_switch, sch_action); int sch_action = getSetting("schAction", i, 0).toInt();
if (sch_action == 2) {
relayToggle(sch_switch);
} else {
relayStatus(sch_switch, sch_action);
}
} }
DEBUG_MSG_P(PSTR("[SCH] Schedule #%d TRIGGERED!!\n"), sch_switch); DEBUG_MSG_P(PSTR("[SCH] Schedule #%d TRIGGERED!!\n"), sch_switch);


|||||||
x
 
000:0
Loading…
Cancel
Save