mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 23:53:29 +02:00
21 lines
506 B
JavaScript
21 lines
506 B
JavaScript
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)
|
|
}
|
|
|
|
|
|
}
|