Browse Source

schedules properly fixed

rfm69
wysiwyng 6 years ago
parent
commit
1bab8e0142
2 changed files with 4 additions and 4 deletions
  1. +1
    -1
      code/espurna/scheduler.ino
  2. +3
    -3
      code/html/custom.js

+ 1
- 1
code/espurna/scheduler.ino View File

@ -26,7 +26,7 @@ void _schWebSocketOnSend(JsonObject &root){
scheduler["schEnabled"] = getSetting("schEnabled", i, 1).toInt() == 1; scheduler["schEnabled"] = getSetting("schEnabled", i, 1).toInt() == 1;
scheduler["schSwitch"] = getSetting("schSwitch", i, 0).toInt(); scheduler["schSwitch"] = getSetting("schSwitch", i, 0).toInt();
scheduler["schAction"] = getSetting("schAction", i, 0).toInt(); scheduler["schAction"] = getSetting("schAction", i, 0).toInt();
scheduler["schType"] = getSetting("schType", i, 0);
scheduler["schType"] = getSetting("schType", i, 0).toInt();
scheduler["schHour"] = getSetting("schHour", i, 0).toInt(); scheduler["schHour"] = getSetting("schHour", i, 0).toInt();
scheduler["schMinute"] = getSetting("schMinute", i, 0).toInt(); scheduler["schMinute"] = getSetting("schMinute", i, 0).toInt();
scheduler["schWDs"] = getSetting("schWDs", i, ""); scheduler["schWDs"] = getSetting("schWDs", i, "");


+ 3
- 3
code/html/custom.js View File

@ -662,7 +662,7 @@ function addSchedule(event) {
var template = $("#scheduleTemplate").children(); var template = $("#scheduleTemplate").children();
var line = $(template).clone(); var line = $(template).clone();
var type = ("1" === event.data.schType) ? "switch" : "light";
var type = (1 === event.data.schType) ? "switch" : "light";
template = $("#" + type + "ActionTemplate").children(); template = $("#" + type + "ActionTemplate").children();
var actionLine = template.clone(); var actionLine = template.clone();
@ -1349,8 +1349,8 @@ $(function() {
$(".button-add-network").on("click", function() { $(".button-add-network").on("click", function() {
$(".more", addNetwork()).toggle(); $(".more", addNetwork()).toggle();
}); });
$(".button-add-switch-schedule").on("click", { schType: "1" }, addSchedule);
$(".button-add-light-schedule").on("click", { schType: "2" }, addSchedule);
$(".button-add-switch-schedule").on("click", { schType: 1 }, addSchedule);
$(".button-add-light-schedule").on("click", { schType: 2 }, addSchedule);
$(document).on("change", "input", hasChanged); $(document).on("change", "input", hasChanged);
$(document).on("change", "select", hasChanged); $(document).on("change", "select", hasChanged);


Loading…
Cancel
Save