Mercurial > code > home > repos > homeauto
view service/laundry/static/gui.js @ 913:18133605e4ce
fix angular api
Ignore-this: b3a3275dec9c6df4770533ab5b865c17
darcs-hash:20130901074604-312f9-87eada22d8fb0530d88856d2fa8c7de0ee8a7151
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sun, 01 Sep 2013 00:46:04 -0700 |
parents | 5758151d4e33 |
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(); }); } }