diff --git a/example.conf b/example.conf index 5835dd7..0135e7b 100644 --- a/example.conf +++ b/example.conf @@ -52,6 +52,8 @@ Slaapkamer lightstrip = 12, rgb Open Garage door = 456, pushon Close Garage door = 567, pushoff + Scene Home = 4, scene + Group kitchen lights = 5, group [[power_usage]] Totaal slaapkamer lamp = 12 Totaal playstation = 71 diff --git a/static/js/domoboard.js b/static/js/domoboard.js index 51fdd52..4c54582 100644 --- a/static/js/domoboard.js +++ b/static/js/domoboard.js @@ -31,6 +31,13 @@ function changePush(idx, action) { } } +function changeScene(idx, action) { + if (action == 'on') { + requestAPI(flask_server + "/api?type=command¶m=switchscene&idx=" + idx + "&switchcmd=On" ); + } else { + requestAPI(flask_server + "/api?type=command¶m=switchscene&idx=" + idx + "&switchcmd=Off" ); + } +} function refreshSwitches(updateSwitches, block) { $.each(updateSwitches, function (i, switchID) { diff --git a/templates/switches.html b/templates/switches.html index 635f67d..bfdc042 100644 --- a/templates/switches.html +++ b/templates/switches.html @@ -23,9 +23,13 @@ {% elif "dimmer" in v[1] %} {% elif "pushon" in v[1] %} - + {% elif "pushoff" in v[1] %} - + + {% elif "group" in v[1] %} +