From 9f271061c4761ef2408d4a68995786b0b48710d2 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 4 Oct 2015 17:08:25 +0300 Subject: [PATCH] light switch detection option is now a slider (was a simple on/off button) --- motioneye/config.py | 4 ++-- motioneye/static/js/main.js | 4 ++-- motioneye/templates/main.html | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/motioneye/config.py b/motioneye/config.py index 1160554..c17b5c9 100644 --- a/motioneye/config.py +++ b/motioneye/config.py @@ -623,7 +623,7 @@ def motion_camera_ui_to_dict(ui, old_config=None): # device '@name': ui['name'], '@enabled': ui['enabled'], - 'lightswitch': int(ui['light_switch_detect']) * 50, + 'lightswitch': ui['light_switch_detect'], 'auto_brightness': ui['auto_brightness'], 'framerate': int(ui['framerate']), 'rotate': int(ui['rotation']), @@ -902,7 +902,7 @@ def motion_camera_dict_to_ui(data): 'name': data['@name'], 'enabled': data['@enabled'], 'id': data['@id'], - 'light_switch_detect': data['lightswitch'] > 0, + 'light_switch_detect': data['lightswitch'], 'auto_brightness': data['auto_brightness'], 'framerate': int(data['framerate']), 'rotation': int(data['rotate']), diff --git a/motioneye/static/js/main.js b/motioneye/static/js/main.js index bd62fa0..0fe6ca7 100644 --- a/motioneye/static/js/main.js +++ b/motioneye/static/js/main.js @@ -1249,7 +1249,7 @@ function cameraUi2Dict() { 'proto': $('#deviceTypeEntry')[0].proto, /* video device */ - 'light_switch_detect': $('#lightSwitchDetectSwitch')[0].checked, + 'light_switch_detect': $('#lightSwitchDetectSlider').val(), 'auto_brightness': $('#autoBrightnessSwitch')[0].checked, 'rotation': $('#rotationSelect').val(), 'framerate': $('#framerateSlider').val(), @@ -1477,7 +1477,7 @@ function dict2CameraUi(dict) { $('#deviceUrlEntry').val(dict['device_url']); markHideIfNull('device_url', 'deviceUrlEntry'); $('#deviceTypeEntry').val(prettyType); markHideIfNull(!prettyType, 'deviceTypeEntry'); $('#deviceTypeEntry')[0].proto = dict['proto']; - $('#lightSwitchDetectSwitch')[0].checked = dict['light_switch_detect']; markHideIfNull('light_switch_detect', 'lightSwitchDetectSwitch'); + $('#lightSwitchDetectSlider').val(dict['light_switch_detect']); markHideIfNull('light_switch_detect', 'lightSwitchDetectSlider'); $('#autoBrightnessSwitch')[0].checked = dict['auto_brightness']; markHideIfNull('auto_brightness', 'autoBrightnessSwitch'); $('#brightnessSlider').val(dict['brightness']); markHideIfNull('brightness', 'brightnessSlider'); diff --git a/motioneye/templates/main.html b/motioneye/templates/main.html index 1349c2d..4a7390e 100644 --- a/motioneye/templates/main.html +++ b/motioneye/templates/main.html @@ -215,16 +215,16 @@
- - Light Switch Detection - - ? - Automatic Brightness ? + + Light Switch Detection + + ? + Brightness -- 2.39.5