Stability fixes

This commit is contained in:
Fabio Manganiello 2018-07-06 03:38:07 +02:00
parent 85cdd8e5af
commit 88d9f9d3ac
2 changed files with 10 additions and 6 deletions

View file

@ -73,14 +73,10 @@ class CameraPiBackend(Backend):
self.camera.rotation = rotation
self.camera.crop = crop
self.start_recording_on_startup = start_recording_on_startup
self.redis = get_backend('redis')
self.redis = None
self.redis_queue = redis_queue
self._recording_thread = None
if self.start_recording_on_startup:
self.send_camera_action(self.CameraAction.START_RECORDING)
self.logger.info('Initialized Pi camera backend')
def send_camera_action(self, action, **kwargs):
action = {
@ -167,6 +163,14 @@ class CameraPiBackend(Backend):
def run(self):
super().run()
if not self.redis:
self.redis = get_backend('redis')
if self.start_recording_on_startup:
self.send_camera_action(self.CameraAction.START_RECORDING)
self.logger.info('Initialized Pi camera backend')
while not self.should_stop():
try:
msg = self.redis.get_message(self.redis_queue)

View file

@ -34,7 +34,7 @@ class GpioSensorPlugin(Plugin):
Alias for ``get_measurement``
"""
return self.get_measurement(*args, **kwargs)
return self.get_measurement(*args, **kwargs).output
# vim:sw=4:ts=4:et: