fix setting timelapse interval
This commit is contained in:
parent
416f6ec2a6
commit
fb7f77b3a8
2 changed files with 8 additions and 3 deletions
|
@ -60,9 +60,10 @@ class CameraWorker(object):
|
||||||
with open(self.fifo, 'w') as fh:
|
with open(self.fifo, 'w') as fh:
|
||||||
fh.write(cmd)
|
fh.write(cmd)
|
||||||
|
|
||||||
def start_timelapse(self, interval = 0):
|
def start_timelapse(self, interval=300):
|
||||||
if self.status == CameraStatus.IDLE:
|
if self.status == CameraStatus.IDLE:
|
||||||
self.send_cmd('tl {}'.format(str(interval)))
|
self.send_cmd('tv {}'.format(str(interval)))
|
||||||
|
self.send_cmd('tl 1')
|
||||||
self.status = CameraStatus.TIMELAPSE
|
self.status = CameraStatus.TIMELAPSE
|
||||||
else:
|
else:
|
||||||
raise CameraActionError('Camera not idle!')
|
raise CameraActionError('Camera not idle!')
|
||||||
|
|
|
@ -46,8 +46,12 @@ def start_stop_timelapse():
|
||||||
|
|
||||||
# camera.set_timelapse_interval(timelapse_interval)
|
# camera.set_timelapse_interval(timelapse_interval)
|
||||||
if camera.status == CameraStatus.IDLE:
|
if camera.status == CameraStatus.IDLE:
|
||||||
camera.start_timelapse(1200)
|
btn_text = "Stop"
|
||||||
|
btn_class = 'btn-danger'
|
||||||
|
camera.start_timelapse()
|
||||||
elif camera.status == CameraStatus.TIMELAPSE:
|
elif camera.status == CameraStatus.TIMELAPSE:
|
||||||
|
btn_text = "Start"
|
||||||
|
btn_class = 'btn-primary'
|
||||||
camera.stop_timelapse()
|
camera.stop_timelapse()
|
||||||
|
|
||||||
return jsonify(btn_text=btn_text, btn_class=btn_class)
|
return jsonify(btn_text=btn_text, btn_class=btn_class)
|
||||||
|
|
Loading…
Add table
Reference in a new issue