Added Wifi enable/disable setting.

This commit is contained in:
Gunther Brunner
2014-07-25 20:16:19 +09:00
parent b79e10c317
commit 7988927c8d
10 changed files with 71 additions and 19 deletions

View File

@@ -0,0 +1,20 @@
module.exports = function DeviceSettingsCtrl($scope, $timeout) {
$scope.wifiEnabled = true
var getWifiStatus = function () {
$scope.control.getWifiStatus().then(function (result) {
$scope.$apply(function () {
$scope.wifiEnabled = (result.lastData === 'wifi_enabled')
})
})
}
getWifiStatus()
$scope.toggleWifi = function () {
$scope.control.setWifiEnabled(!$scope.wifiEnabled)
$scope.wifiEnabled = !$scope.wifiEnabled
$timeout(getWifiStatus, 500)
}
}