From 12caf28627ee4a26490b4e85e630012cd3ecaa4e Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Mon, 12 Sep 2016 22:42:24 +0300 Subject: [PATCH] onyl smart and editable mask types will be supported --- motioneye/config.py | 15 +++++++++++---- motioneye/templates/main.html | 8 +------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/motioneye/config.py b/motioneye/config.py index 4b82ad9..b3684f0 100644 --- a/motioneye/config.py +++ b/motioneye/config.py @@ -875,9 +875,6 @@ def motion_camera_ui_to_dict(ui, old_config=None): elif ui['mask_type'] == 'editable': data['mask_file'] = utils.build_editable_mask_file(ui['editable_mask']) - else: - data['mask_file'] = ui['mask_file'] - # working schedule if ui['working_schedule']: data['@working_schedule'] = ( @@ -1060,7 +1057,6 @@ def motion_camera_dict_to_ui(data): 'mask': False, 'mask_type': 'smart', 'smart_mask_slugginess': 5, - 'mask_file': '', 'editable_mask': '', # motion notifications @@ -1245,6 +1241,17 @@ def motion_camera_dict_to_ui(data): ui['movie_quality'] = int(q) + # mask + if data['mask_file']: + ui['mask'] = True + ui['mask_type'] = 'editable' + ui['editable_mask'] = utils.parse_editable_mask_file(data['mask_file']) + + elif data['smart_mask_speed']: + ui['mask'] = True + ui['mask_type'] = 'smart' + ui['smart_mask_slugginess'] = 10 - data['smart_mask_speed'] + # working schedule working_schedule = data['@working_schedule'] if working_schedule: diff --git a/motioneye/templates/main.html b/motioneye/templates/main.html index 20df1ef..9b579e3 100644 --- a/motioneye/templates/main.html +++ b/motioneye/templates/main.html @@ -826,21 +826,15 @@ - ? + ? Smart Mask Slugginess ? - - Mask File - - ? - {% for config in camera_sections.get('motion-detection', {}).get('configs', []) %} {{config_item(config)}} {% endfor %} -- 2.39.5