if ui['mask']:
if ui['mask_type'] == 'smart':
- data['smart_mask_speed'] = 10 - int(ui['smart_mask_slugginess'])
+ data['smart_mask_speed'] = 10 - int(ui['smart_mask_sluggishness'])
elif ui['mask_type'] == 'editable':
data['mask_file'] = utils.build_editable_mask_file(old_config['@id'], ui['mask_lines'], data.get('width'), data.get('height'))
'minimum_motion_frames': int(data['minimum_motion_frames']),
'mask': False,
'mask_type': 'smart',
- 'smart_mask_slugginess': 5,
+ 'smart_mask_sluggishness': 5,
'mask_lines': [],
# motion notifications
elif data['smart_mask_speed']:
ui['mask'] = True
ui['mask_type'] = 'smart'
- ui['smart_mask_slugginess'] = 10 - data['smart_mask_speed']
+ ui['smart_mask_sluggishness'] = 10 - data['smart_mask_speed']
# working schedule
working_schedule = data['@working_schedule']
'minimum_motion_frames': $('#minimumMotionFramesEntry').val(),
'mask': $('#maskSwitch')[0].checked,
'mask_type': $('#maskTypeSelect').val(),
- 'smart_mask_slugginess': $('#smartMaskSlugginessSlider').val(),
+ 'smart_mask_sluggishness': $('#smartMaskSluggishnessSlider').val(),
'mask_lines': $('#maskLinesEntry').val() ? $('#maskLinesEntry').val().split(',').map(function (l) {return parseInt(l);}) : [],
/* motion notifications */
$('#minimumMotionFramesEntry').val(dict['minimum_motion_frames']); markHideIfNull('minimum_motion_frames', 'minimumMotionFramesEntry');
$('#maskSwitch')[0].checked = dict['mask']; markHideIfNull('mask', 'maskSwitch');
$('#maskTypeSelect').val(dict['mask_type']); markHideIfNull('mask_type', 'maskTypeSelect');
- $('#smartMaskSlugginessSlider').val(dict['smart_mask_slugginess']); markHideIfNull('smart_mask_slugginess', 'smartMaskSlugginessSlider');
+ $('#smartMaskSluggishnessSlider').val(dict['smart_mask_sluggishness']); markHideIfNull('smart_mask_sluggishness', 'smartMaskSluggishnessSlider');
$('#maskLinesEntry').val((dict['mask_lines'] || []).join(',')); markHideIfNull('mask_lines', 'maskLinesEntry');
/* motion notifications */
<td class="settings-item-value"><input type="text" class="number styled motion-detection camera-config" id="eventGapEntry"><span class="settings-item-unit">seconds</span></td>
<td><span class="help-mark" title="sets the number of seconds of silence (i.e. no motion) that mark the end of a motion event">?</span></td>
</tr>
- <tr class="settings-item advanced-setting" min="0" max="100" required="true">
+ <tr class="settings-item advanced-setting" min="0" max="1000" required="true">
<td class="settings-item-label"><span class="settings-item-label">Captured Before</span></td>
<td class="settings-item-value"><input type="text" class="number styled motion-detection camera-config" id="preCaptureEntry"><span class="settings-item-unit">frames</span></td>
<td><span class="help-mark" title="sets the number of frames to be captured (and included in the movie) before a motion event is detected">?</span></td>
</tr>
- <tr class="settings-item advanced-setting" min="0" max="100" required="true">
+ <tr class="settings-item advanced-setting" min="0" max="1000" required="true">
<td class="settings-item-label"><span class="settings-item-label">Captured After</span></td>
<td class="settings-item-value"><input type="text" class="number styled motion-detection camera-config" id="postCaptureEntry"><span class="settings-item-unit">frames</span></td>
- <td><span class="help-mark" title="sets the number of frames to be captured (and included in the movie) after a motion event is detected">?</span></td>
+ <td><span class="help-mark" title="sets the number of frames to be captured (and included in the movie) after the end of a motion event">?</span></td>
</tr>
<tr class="settings-item advanced-setting" min="1" max="1000" required="true">
<td class="settings-item-label"><span class="settings-item-label">Minimum Motion Frames</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 class="settings-item-label"><span class="settings-item-label">Smart Mask Sluggishness</span></td>
+ <td class="settings-item-value"><input type="text" class="range styled motion-detection camera-config" id="smartMaskSluggishnessSlider"></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" depends="mask maskType=editable">
def build_editable_mask_file(camera_id, mask_lines, capture_width=None, capture_height=None):
+ if not mask_lines:
+ return ''
+
width = mask_lines[0]
height = mask_lines[1]
mask_lines = mask_lines[2:]