Mercurial > code > home > repos > homeauto
view 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 |
line wrap: on
line source
'use strict'; function Ctrl($scope, $http, $timeout) { $scope.refresh = function () { $http.get("status").success(function (data) { $scope.status = data; }); } $scope.refresh(); $scope.setLed = function (value) { $http.put("led", value).success(function () { $scope.refresh(); }); }; $scope.temporaryUnlock = function () { var seconds = 3; $http.put("strike/temporaryUnlock", {seconds: seconds}).success(function () { $scope.refresh(); $timeout($scope.refresh, (seconds + .1) * 1000); }); }; $scope.beep = function () { $http.put("speaker/beep").success(function () { $scope.speakerStatus = "sent at " + new Date(); }); } }