forked from platypush/platypush
Added start/stop preview camera actions
This commit is contained in:
parent
c93af07333
commit
6465a6f282
1 changed files with 19 additions and 0 deletions
|
@ -76,6 +76,25 @@ class CameraPiPlugin(CameraPlugin):
|
||||||
|
|
||||||
return self._camera
|
return self._camera
|
||||||
|
|
||||||
|
@action
|
||||||
|
def start_preview(self, **opts):
|
||||||
|
"""
|
||||||
|
Start camera preview.
|
||||||
|
|
||||||
|
:param opts: Extra options to pass to the camera (see
|
||||||
|
https://www.raspberrypi.org/documentation/usage/camera/python/README.md)
|
||||||
|
"""
|
||||||
|
camera = self._get_camera(**opts)
|
||||||
|
camera.start_preview()
|
||||||
|
|
||||||
|
@action
|
||||||
|
def stop_preview(self):
|
||||||
|
"""
|
||||||
|
Stop camera preview.
|
||||||
|
"""
|
||||||
|
camera = self._get_camera()
|
||||||
|
camera.stop_preview()
|
||||||
|
|
||||||
@action
|
@action
|
||||||
def take_picture(self, image_file, preview=False, warmup_time=2, resize=None, **opts):
|
def take_picture(self, image_file, preview=False, warmup_time=2, resize=None, **opts):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue