From e48ca49ffac8f867e7dd6b7f5d754494087b0f3f Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 29 Oct 2017 15:11:55 +0200 Subject: [PATCH] mmal: minor cosmetic changes --- motioneye/config.py | 2 +- motioneye/handlers.py | 8 +++++--- motioneye/static/js/main.js | 6 +++--- motioneye/utils.py | 3 +++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/motioneye/config.py b/motioneye/config.py index f915a97..5100c95 100644 --- a/motioneye/config.py +++ b/motioneye/config.py @@ -543,7 +543,7 @@ def add_camera(device_details): while camera_id in camera_ids: camera_id += 1 - logging.info('adding new %(prt)s camera with id %(id)s...' % {'prt': proto, 'id': camera_id}) + logging.info('adding new %(proto)s camera with id %(id)s...' % {'proto': proto, 'id': camera_id}) # prepare a default camera config camera_config = {'@enabled': True} diff --git a/motioneye/handlers.py b/motioneye/handlers.py index fb1c93e..2622d5a 100644 --- a/motioneye/handlers.py +++ b/motioneye/handlers.py @@ -647,7 +647,7 @@ class ConfigHandler(BaseHandler): configured_devices.add(data['videodevice']) cameras = [{'id': d[1], 'name': d[2]} for d in v4l2ctl.list_devices() - if (d[0] not in configured_devices) and (d[1] not in configured_devices)] + if (d[0] not in configured_devices) and (d[1] not in configured_devices)] self.finish_json({'cameras': cameras}) @@ -660,9 +660,10 @@ class ConfigHandler(BaseHandler): if "vc.ril.camera" not in configured_devices: cameras = [{'id': "vc.ril.camera", 'name': "VideoCore Camera (vc.ril.camera)"}] + else: - cameras = [] - + cameras = [] + self.finish_json({'cameras': cameras}) else: # assuming local motionEye camera listing @@ -679,6 +680,7 @@ class ConfigHandler(BaseHandler): self.finish_json({'cameras': cameras}) def on_response_builder(camera_id, local_config): + def on_response(remote_ui_config=None, error=None): if error: cameras.append({ diff --git a/motioneye/static/js/main.js b/motioneye/static/js/main.js index 3438c9c..e11ff16 100644 --- a/motioneye/static/js/main.js +++ b/motioneye/static/js/main.js @@ -3569,7 +3569,7 @@ function runAddCameraDialog() { '' + 'Camera Type' + '