From: Calin Crisan Date: Mon, 12 Oct 2015 17:44:48 +0000 (+0300) Subject: light switch detection moved to motion detection section X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=258309da8f75240045a736fae0eb9ac25eb02d31;p=motioneye-debian light switch detection moved to motion detection section --- diff --git a/motioneye/config.py b/motioneye/config.py index 6960894..e81d359 100644 --- a/motioneye/config.py +++ b/motioneye/config.py @@ -623,7 +623,6 @@ def motion_camera_ui_to_dict(ui, old_config=None): # device '@name': ui['name'], '@enabled': ui['enabled'], - 'lightswitch': ui['light_switch_detect'], 'auto_brightness': ui['auto_brightness'], 'framerate': int(ui['framerate']), 'rotate': int(ui['rotation']), @@ -673,6 +672,7 @@ def motion_camera_ui_to_dict(ui, old_config=None): 'locate_motion_mode': ui['show_frame_changes'], 'noise_tune': ui['auto_noise_detect'], 'noise_level': max(1, int(round(int(ui['noise_level']) * 2.55))), + 'lightswitch': ui['light_switch_detect'], 'event_gap': int(ui['event_gap']), 'pre_capture': int(ui['pre_capture']), 'post_capture': int(ui['post_capture']), @@ -910,7 +910,6 @@ def motion_camera_dict_to_ui(data): 'name': data['@name'], 'enabled': data['@enabled'], 'id': data['@id'], - 'light_switch_detect': data['lightswitch'], 'auto_brightness': data['auto_brightness'], 'framerate': int(data['framerate']), 'rotation': int(data['rotate']), @@ -963,6 +962,7 @@ def motion_camera_dict_to_ui(data): 'show_frame_changes': data['text_changes'] or data['locate_motion_mode'], 'auto_noise_detect': data['noise_tune'], 'noise_level': int(int(data['noise_level']) / 2.55), + 'light_switch_detect': data['lightswitch'], 'event_gap': int(data['event_gap']), 'pre_capture': int(data['pre_capture']), 'post_capture': int(data['post_capture']), @@ -1600,7 +1600,6 @@ def _set_default_motion_camera(camera_id, data): data.setdefault('width', 352) data.setdefault('height', 288) - data.setdefault('lightswitch', 50) data.setdefault('auto_brightness', False) data.setdefault('framerate', 2) data.setdefault('rotate', 0) @@ -1634,6 +1633,7 @@ def _set_default_motion_camera(camera_id, data): data.setdefault('threshold', 2000) data.setdefault('noise_tune', True) data.setdefault('noise_level', 32) + data.setdefault('lightswitch', 50) data.setdefault('minimum_motion_frames', 1) data.setdefault('pre_capture', 2) diff --git a/motioneye/static/js/main.js b/motioneye/static/js/main.js index c192f4e..0ea2840 100644 --- a/motioneye/static/js/main.js +++ b/motioneye/static/js/main.js @@ -1274,7 +1274,6 @@ function cameraUi2Dict() { 'proto': $('#deviceTypeEntry')[0].proto, /* video device */ - 'light_switch_detect': $('#lightSwitchDetectSlider').val(), 'auto_brightness': $('#autoBrightnessSwitch')[0].checked, 'rotation': $('#rotationSelect').val(), 'framerate': $('#framerateSlider').val(), @@ -1347,6 +1346,7 @@ function cameraUi2Dict() { 'frame_change_threshold': $('#frameChangeThresholdSlider').val(), 'auto_noise_detect': $('#autoNoiseDetectSwitch')[0].checked, 'noise_level': $('#noiseLevelSlider').val(), + 'light_switch_detect': $('#lightSwitchDetectSlider').val(), 'event_gap': $('#eventGapEntry').val(), 'pre_capture': $('#preCaptureEntry').val(), 'post_capture': $('#postCaptureEntry').val(), @@ -1503,7 +1503,6 @@ function dict2CameraUi(dict) { $('#deviceUrlEntry').val(dict['device_url']); markHideIfNull('device_url', 'deviceUrlEntry'); $('#deviceTypeEntry').val(prettyType); markHideIfNull(!prettyType, 'deviceTypeEntry'); $('#deviceTypeEntry')[0].proto = dict['proto']; - $('#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'); @@ -1655,6 +1654,7 @@ function dict2CameraUi(dict) { $('#frameChangeThresholdSlider').val(dict['frame_change_threshold']); markHideIfNull('frame_change_threshold', 'frameChangeThresholdSlider'); $('#autoNoiseDetectSwitch')[0].checked = dict['auto_noise_detect']; markHideIfNull('auto_noise_detect', 'autoNoiseDetectSwitch'); $('#noiseLevelSlider').val(dict['noise_level']); markHideIfNull('noise_level', 'noiseLevelSlider'); + $('#lightSwitchDetectSlider').val(dict['light_switch_detect']); markHideIfNull('light_switch_detect', 'lightSwitchDetectSlider'); $('#eventGapEntry').val(dict['event_gap']); markHideIfNull('event_gap', 'eventGapEntry'); $('#preCaptureEntry').val(dict['pre_capture']); markHideIfNull('pre_capture', 'preCaptureEntry'); $('#postCaptureEntry').val(dict['post_capture']); markHideIfNull('post_capture', 'postCaptureEntry'); diff --git a/motioneye/templates/main.html b/motioneye/templates/main.html index 1abebdd..6ccd717 100644 --- a/motioneye/templates/main.html +++ b/motioneye/templates/main.html @@ -224,11 +224,6 @@ ? - - Light Switch Detection - - ? - Brightness @@ -606,6 +601,11 @@ ? + + Light Switch Detection + + ? +