Mercurial > code > home > repos > homeauto
annotate service/laundry/static/gui.js @ 99:3c583603f261
start switch to goweb, for improved incoming payload handling
Ignore-this: 18f1a3f3fef04a22a1d4e84a6e5e09ca
author | drewp@bigasterisk.com |
---|---|
date | Sat, 31 Aug 2013 11:24:09 -0700 |
parents | 27a685ce2e5d |
children | 64ad5ad17dc1 |
rev | line source |
---|---|
93 | 1 'use strict'; |
2 | |
99
3c583603f261
start switch to goweb, for improved incoming payload handling
drewp@bigasterisk.com
parents:
96
diff
changeset
|
3 |
93 | 4 function Ctrl($scope, $http) { |
95 | 5 function refresh() { |
6 $http.get("status").success(function (data) { | |
7 $scope.status = data; | |
8 }); | |
9 } | |
10 refresh(); | |
11 $scope.setLed = function (value) { | |
12 $http.put("led", value).succeed(function () { | |
13 refresh(); | |
14 }); | |
96 | 15 }; |
16 $scope.temporaryUnlock = function () { | |
17 var seconds = 3; | |
18 $http.put("strike/temporaryUnlock", {seconds: seconds}).succeed(function () { | |
19 refresh(); | |
20 setTimeout(function () { refresh(); }, (seconds + .1) * 1000); | |
21 }); | |
22 }; | |
23 $scope.beep = function () { | |
24 $http.put("speaker/beep").succeed(function () { | |
25 $scope.speakerStatus = "sent at " + new Date(); | |
26 }); | |
95 | 27 } |
93 | 28 } |