From 35c5e2d8f793e900ef891efa62a2f44af422f663 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 17 Jul 2018 00:59:02 +0200 Subject: [PATCH] Serial plugin now extends the general sensor plugin class --- platypush/plugins/serial/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platypush/plugins/serial/__init__.py b/platypush/plugins/serial/__init__.py index a49860c73..065208940 100644 --- a/platypush/plugins/serial/__init__.py +++ b/platypush/plugins/serial/__init__.py @@ -2,9 +2,10 @@ import json import serial from platypush.plugins import Plugin, action +from platypush.plugins.gpio.sensor import GpioSensorPlugin -class SerialPlugin(Plugin): +class SerialPlugin(GpioSensorPlugin): """ The serial plugin can read data from a serial device, as long as the serial device returns a JSON. You can use this plugin to interact for example with @@ -59,7 +60,7 @@ class SerialPlugin(Plugin): return output.decode().strip() @action - def get_data(self): + def get_measurement(self): """ Reads JSON data from the serial device and returns it as a message """