Skip to content

Commit

Permalink
Add checkbox for "Enable when lights appear" to gui
Browse files Browse the repository at this point in the history
  • Loading branch information
sarangak committed May 2, 2020
1 parent c6afba4 commit d5c8277
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gui/static/js/schedules.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function readSchedule(target){
schedule.name = $(target).find(".name").val().trim();
console.log($(target).find(".lights").val())
schedule.associatedDeviceIDs = parseIDs($(target).find(".lights").val().trim());
schedule.enableWhenLightsAppear = $(target).find(".appearBehavior").is(":checked");
console.log(schedule);
return schedule;
}
Expand Down Expand Up @@ -85,6 +86,7 @@ function addSchedule(target) {
var basic = $('<form class="form-horizontal">');
basic.append('<div class="form-group"><label>Name:</label><input type="text" class="name form-control" placeholder="Livingroom" autocomplete="off"></div>');
basic.append('<div class="form-group"><label>Lights:</label><input type="text" class="lights form-control" placeholder="1,2,3" autocomplete="off"></div>');
basic.append('<div class="form-group"><label class="form-check-label">Enable when lights appear?</label><input type="checkbox" class="appearBehavior form-check-input" autocomplete="off"></div>');
collumn.append(basic)

<!-- Schedule before sunrise -->
Expand Down
4 changes: 4 additions & 0 deletions gui/template/schedules.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ <h1>Kelvin schedules</h1>
<label>Lights:</label>
<input type="text" class="lights form-control" value="{{.AssociatedDeviceIDs|lightsToString}}" autocomplete="off">
</div>
<div class="form-group">
<label class="form-check-label">Enable when lights appear?</label>
<input type="checkbox" class="appearBehavior form-check-input" {{if .EnableWhenLightsAppear}}checked{{end}} autocomplete="off">
</div>
</form>
<div class="subschedule">
<h1>Morning <small>(00:00 - sunrise)</small></h1>
Expand Down

0 comments on commit d5c8277

Please sign in to comment.