expose ptz

This commit is contained in:
j 2020-12-05 11:39:05 +01:00
parent 2a3b48860d
commit 546795c2b6
2 changed files with 12 additions and 1 deletions

View File

@ -120,6 +120,18 @@ class API(object):
json.dump(data, fd, indent=4) json.dump(data, fd, indent=4)
return result return result
def move(self, **data):
result = {}
if data.get('direction') in (
'LEFT', 'RIGHT', 'UP', 'DOWN',
'LEFT_UP', 'LEFT_DOWN',
'RIGHT_UP', 'RIGHT_DOWN',
'IN', 'OUT',
):
direction = getattr(ctl.camera, data['direction'])
ctl.camera.momentary(direction, float(data.get('duration', 1)))
return result
def stop(self, **data): def stop(self, **data):
result = {} result = {}
ctl.camera.abort = True ctl.camera.abort = True

View File

@ -662,5 +662,4 @@ function init_shift() {
updateShiftStatus() updateShiftStatus()
setInterval(updateShiftStatus, 5000) setInterval(updateShiftStatus, 5000)
}) })
} }