diff --git a/res/app/control-panes/advanced/input/index.js b/res/app/control-panes/advanced/input/index.js index fcf2b799..6fa33a00 100644 --- a/res/app/control-panes/advanced/input/index.js +++ b/res/app/control-panes/advanced/input/index.js @@ -1,7 +1,6 @@ require('./input.css') module.exports = angular.module('stf.advanced.input', [ - require('stf/keycodes').name ]) .run(["$templateCache", function ($templateCache) { $templateCache.put('control-panes/advanced/input/input.jade', diff --git a/res/app/control-panes/advanced/input/input-controller.js b/res/app/control-panes/advanced/input/input-controller.js index af6b130e..9da73c59 100644 --- a/res/app/control-panes/advanced/input/input-controller.js +++ b/res/app/control-panes/advanced/input/input-controller.js @@ -1,4 +1,4 @@ -module.exports = function InputCtrl($scope, KeycodesAndroid) { +module.exports = function InputCtrl($scope) { $scope.press = function (key) { $scope.control.keyPress(key) diff --git a/res/app/control-panes/automation/device-settings/device-settings-controller.js b/res/app/control-panes/automation/device-settings/device-settings-controller.js index 13fe2471..eb2296f2 100644 --- a/res/app/control-panes/automation/device-settings/device-settings-controller.js +++ b/res/app/control-panes/automation/device-settings/device-settings-controller.js @@ -1,7 +1,7 @@ module.exports = function DeviceSettingsCtrl($scope, $timeout) { $scope.wifiEnabled = true - var getWifiStatus = function () { + function getWifiStatus() { if ($scope.control) { $scope.control.getWifiStatus().then(function (result) { $scope.$apply(function () { @@ -9,7 +9,6 @@ module.exports = function DeviceSettingsCtrl($scope, $timeout) { }) }) } - } getWifiStatus() @@ -17,7 +16,28 @@ module.exports = function DeviceSettingsCtrl($scope, $timeout) { if ($scope.control) { $scope.control.setWifiEnabled(!$scope.wifiEnabled) $scope.wifiEnabled = !$scope.wifiEnabled - $timeout(getWifiStatus, 500) + $timeout(getWifiStatus, 300) + $timeout(getWifiStatus, 2500) } } + + $scope.$watch('ringerMode', function (newValue, oldValue) { + if (oldValue) { + if ($scope.control) { + $scope.control.setRingerMode(newValue) + } + } + }) + + function getRingerMode() { + if ($scope.control) { + $scope.control.getRingerMode().then(function (result) { + $scope.$apply(function () { + $scope.ringerMode = result.body + }) + }) + } + } + getRingerMode() + } diff --git a/res/app/control-panes/automation/device-settings/device-settings.jade b/res/app/control-panes/automation/device-settings/device-settings.jade index 94953ca5..0cd709b2 100644 --- a/res/app/control-panes/automation/device-settings/device-settings.jade +++ b/res/app/control-panes/automation/device-settings/device-settings.jade @@ -6,5 +6,21 @@ button.btn.btn-sm.btn-primary-outline(ng-click='toggleWifi()', ng-model='wifiEnabled', btn-checkbox) - i.fa.fa-signal(ng-show='wifiEnabled', tooltip='{{"Disable WiFi" | translate}}', tooltip-placement='bottom') - i.fa.fa-signal(ng-hide='wifiEnabled', tooltip='{{"Enable WiFi" | translate}}', tooltip-placement='bottom') + i.fa.fa-signal.fa-fw(ng-show='wifiEnabled', tooltip='{{"Disable WiFi" | translate}}') + i.fa.fa-signal.fa-fw(ng-hide='wifiEnabled', tooltip='{{"Enable WiFi" | translate}}') + + //.btn-group + label.btn.btn-sm.btn-primary-outline(ng-model='wifiEnabled', btn-radio='false') + span.fa-stack.fa-lgx + i.fa.fa-signal.fa-stack-1x + i.fa.fa-ban.fa-stack-2x + label.btn.btn-sm.btn-primary-outline(ng-model='wifiEnabled', btn-radio='true') + i.fa.fa-signal.fa-fw(tooltip='{{"WiFi Enabled" | translate}}') + + .btn-group + label.btn.btn-sm.btn-primary-outline(ng-model='ringerMode', btn-radio='"SILENT"') + i.fa.fa-volume-off.fa-fw(tooltip='{{"Silent Mode" | translate}}') + label.btn.btn-sm.btn-primary-outline(ng-model='ringerMode', btn-radio='"VIBRATE"') + i.fa.fa-mobile.fa-fw(tooltip='{{"Vibrate Mode" | translate}}') + label.btn.btn-sm.btn-primary-outline(ng-model='ringerMode', btn-radio='"NORMAL"') + i.fa.fa-volume-up.fa-fw(tooltip='{{"Normal Mode" | translate}}')