From 60d5e7a0f614b77271526ff068df8ed7a85a49e0 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 17 Dec 2019 20:00:08 +0100 Subject: [PATCH] Response cast fix --- platypush/backend/http/app/routes/plugins/camera/pi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platypush/backend/http/app/routes/plugins/camera/pi.py b/platypush/backend/http/app/routes/plugins/camera/pi.py index 95facf4b..52c29bc9 100644 --- a/platypush/backend/http/app/routes/plugins/camera/pi.py +++ b/platypush/backend/http/app/routes/plugins/camera/pi.py @@ -17,10 +17,10 @@ __routes__ = [ def get_frame_file(*args, **kwargs): response = send_request(*args, action='camera.pi.take_picture', image_file=filename, **kwargs) - assert response['output'] and 'image_file' in response['output'],\ - response['errors'].get(0, 'Unable to capture an image file') + assert response.output and 'image_file' in response.output,\ + (response.errors[0] if response.errors else 'Unable to capture frame from the picamera') - return response['output']['image_file'] + return response.output['image_file'] def video_feed():