Serial plugin now extends the general sensor plugin class

This commit is contained in:
Fabio Manganiello 2018-07-17 00:59:02 +02:00
parent 86754534ae
commit 35c5e2d8f7
1 changed files with 3 additions and 2 deletions

View File

@ -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
"""