Mercurial > code > home > repos > homeauto
annotate service/laundry/static/gui.js @ 162:bb70eaa45666
whitespace
Ignore-this: 29ddf8925c373bdb1ec8f62a01f0ac4f
author | drewp@bigasterisk.com |
---|---|
date | Sun, 22 Mar 2015 00:41:55 -0700 |
parents | 64ad5ad17dc1 |
children |
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 |
108 | 4 function Ctrl($scope, $http, $timeout) { |
5 $scope.refresh = function () { | |
95 | 6 $http.get("status").success(function (data) { |
7 $scope.status = data; | |
8 }); | |
9 } | |
108 | 10 $scope.refresh(); |
95 | 11 $scope.setLed = function (value) { |
108 | 12 $http.put("led", value).success(function () { |
13 $scope.refresh(); | |
95 | 14 }); |
96 | 15 }; |
16 $scope.temporaryUnlock = function () { | |
17 var seconds = 3; | |
108 | 18 $http.put("strike/temporaryUnlock", {seconds: seconds}).success(function () { |
19 $scope.refresh(); | |
20 $timeout($scope.refresh, (seconds + .1) * 1000); | |
96 | 21 }); |
22 }; | |
23 $scope.beep = function () { | |
108 | 24 $http.put("speaker/beep").success(function () { |
96 | 25 $scope.speakerStatus = "sent at " + new Date(); |
26 }); | |
95 | 27 } |
93 | 28 } |