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'] = (
'mask': False,
'mask_type': 'smart',
'smart_mask_slugginess': 5,
- 'mask_file': '',
'editable_mask': '',
# motion notifications
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:
<select class="styled motion-detection camera-config" id="maskTypeSelect">
<option value="smart">Smart</option>
<option value="editable">Editable</option>
- <option value="file">File</option>
</select>
</td>
- <td><span class="help-mark" title="the smart option automatically detects regions with regular motion and builds an internal mask, the editable mask allows you to manually build it and the file option allows you to specify a mask file (not recommended)">?</span></td>
+ <td><span class="help-mark" title="the smart option automatically detects regions with regular motion and dynamically builds an internal mask, while the editable mask allows you to manually build it yourself">?</span></td>
</tr>
<tr class="settings-item advanced-setting" min="1" max="10" snap="1" ticksnum="10" decimals="0" unit="" depends="mask maskType=smart">
<td class="settings-item-label"><span class="settings-item-label">Smart Mask Slugginess</span></td>
<td class="settings-item-value"><input type="text" class="range styled motion-detection camera-config" id="smartMaskSlugginessSlider"></td>
<td><span class="help-mark" title="lower values result in a longer-lasting smart mask with a slower building process">?</span></td>
</tr>
- <tr class="settings-item advanced-setting" required="true" depends="mask maskType=file" strip="true">
- <td class="settings-item-label"><span class="settings-item-label">Mask File</span></td>
- <td class="settings-item-value"><input type="text" class="styled motion-detection camera-config" id="maskFileEntry"></td>
- <td><span class="help-mark" title="full path to the PGM mask image file">?</span></td>
- </tr>
{% for config in camera_sections.get('motion-detection', {}).get('configs', []) %}
{{config_item(config)}}
{% endfor %}