From 33a507f0473accd701401d8a0ed28d72dda395a4 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 11 Jun 2018 23:49:37 +0200 Subject: [PATCH] Simplified SensorBackend implementations --- platypush/backend/sensor/__init__.py | 1 + platypush/backend/sensor/serial.py | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/platypush/backend/sensor/__init__.py b/platypush/backend/sensor/__init__.py index 3a6bb475..8b31ba1a 100644 --- a/platypush/backend/sensor/__init__.py +++ b/platypush/backend/sensor/__init__.py @@ -29,6 +29,7 @@ class SensorBackend(Backend): def run(self): super().run() + self.logger.info('Initialized {} sensor backend'.format(self.__class__.__name__)) while not self.should_stop(): new_data = self.get_measurement() diff --git a/platypush/backend/sensor/serial.py b/platypush/backend/sensor/serial.py index 4c3fbd32..cda03f1a 100644 --- a/platypush/backend/sensor/serial.py +++ b/platypush/backend/sensor/serial.py @@ -1,21 +1,12 @@ -import serial - from platypush.backend.sensor import SensorBackend from platypush.context import get_plugin class SensorSerialBackend(SensorBackend): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - def get_measurement(self): plugin = get_plugin('serial') return plugin.get_data().output - def run(self): - self.logger.info('Initialized serial backend') - super().run() - # vim:sw=4:ts=4:et: