implement get_image in new camera module

This commit is contained in:
Alexander Minges 2019-02-01 12:52:02 +01:00
parent 7558c6d196
commit c13cb3355e

View file

@ -6,6 +6,7 @@ import subprocess
import signal import signal
from enum import Enum from enum import Enum
from PIL import Image
from phytopi import db, models, app from phytopi import db, models, app
class CameraActionError(Exception): class CameraActionError(Exception):
@ -68,4 +69,9 @@ class CameraWorker(object):
self.status == CameraStatus.IDLE self.status == CameraStatus.IDLE
else: else:
raise CameraActionError('Camera neither idle nor in timelapse mode!') raise CameraActionError('Camera neither idle nor in timelapse mode!')
def get_frame(self, thumbnail=False):
img = Image.open('/dev/shm/mjpeg/cam.jpg')
return img