From 9c581917227f104aeccf8b7f0d899a60cbed79c2 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 23 Nov 2021 10:48:08 +0100 Subject: [PATCH] fix default duration --- server.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 759833b..74b1d5d 100755 --- a/server.py +++ b/server.py @@ -138,8 +138,13 @@ class API(object): speed = int(data.get('speed', 1)) for key in direction: direction[key] *= speed - print('move', direction) - ctl.camera.momentary(direction, float(data.get('duration', 1))) + duration = data.get('duration', 1) + try: + duration = float(duration) + except: + duration = 1.0 + print('move', direction, duration) + ctl.camera.momentary(direction, duration) return result def stop(self, **data):