Mercurial > code > home > repos > homeauto
annotate service/laundry/static/gui.js @ 1133:114ca7fd9d01
IR remote rule
Ignore-this: 901771de421a81129f2ddf4316af91d9
darcs-hash:a037a1bcf9631ac214fe1e61ff42fb00f25cb451
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sat, 03 Feb 2018 14:38:10 -0800 |
parents | 18133605e4ce |
children |
rev | line source |
---|---|
899 | 1 'use strict'; |
2 | |
904
5758151d4e33
start switch to goweb, for improved incoming payload handling
drewp <drewp@bigasterisk.com>
parents:
901
diff
changeset
|
3 |
913 | 4 function Ctrl($scope, $http, $timeout) { |
5 $scope.refresh = function () { | |
900 | 6 $http.get("status").success(function (data) { |
7 $scope.status = data; | |
8 }); | |
9 } | |
913 | 10 $scope.refresh(); |
900 | 11 $scope.setLed = function (value) { |
913 | 12 $http.put("led", value).success(function () { |
13 $scope.refresh(); | |
900 | 14 }); |
901 | 15 }; |
16 $scope.temporaryUnlock = function () { | |
17 var seconds = 3; | |
913 | 18 $http.put("strike/temporaryUnlock", {seconds: seconds}).success(function () { |
19 $scope.refresh(); | |
20 $timeout($scope.refresh, (seconds + .1) * 1000); | |
901 | 21 }); |
22 }; | |
23 $scope.beep = function () { | |
913 | 24 $http.put("speaker/beep").success(function () { |
901 | 25 $scope.speakerStatus = "sent at " + new Date(); |
26 }); | |
900 | 27 } |
899 | 28 } |