mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 08:43:45 +02:00
Added Wifi enable/disable setting.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user