Mercurial > code > home > repos > homeauto
diff service/laundry/static/gui.js @ 900:531fce163cbd
more laundry webpage
Ignore-this: 37af9a1a317728d0e460e5c2a482b4b6
darcs-hash:20130827051129-312f9-80ed32d3f53bffe9e9637fafb48e4c6a5ed5f845
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Mon, 26 Aug 2013 22:11:29 -0700 |
parents | 2d718e542198 |
children | c06fdb61157f |
line wrap: on
line diff
--- a/service/laundry/static/gui.js Sat Aug 24 22:54:34 2013 -0700 +++ b/service/laundry/static/gui.js Mon Aug 26 22:11:29 2013 -0700 @@ -1,7 +1,16 @@ 'use strict'; function Ctrl($scope, $http) { - $http.get("status").success(function (data) { - $scope.status = data; - }); + function refresh() { + $http.get("status").success(function (data) { + $scope.status = data; + }); + } + refresh(); + $scope.setLed = function (value) { + $http.put("led", value).succeed(function () { + refresh(); + }); + } + }