# scale the mask vertically in case the aspect ratio has changed
# since the last time the mask has been generated
- if mask_height == len(mask_lines):
+ if ny == len(mask_lines):
line_index_func = lambda y: y
else:
- line_index_func = lambda y: (len(mask_lines) - 1) * y / (mask_height - 1)
+ line_index_func = lambda y: (len(mask_lines) - 1) * y / (ny - 1)
rh = height / ny # rectangle height
def on_motion_detection_status(camera_id, must_be_enabled, working_schedule_type, enabled=None, error=None):
if error: # could not detect current status
- return logging.warn('skipping motion detection status update for camera with id %(id)s' % {'id': camera_id})
+ return logging.warn('skipping motion detection status update for camera with id %(id)s: %(error)s' % {
+ 'id': camera_id, 'error': error})
if enabled and not must_be_enabled:
logging.debug('must disable motion detection for camera with id %(id)s (%(what)s working schedule)' % {