forked from platypush/platypush
Serial plugin now extends the general sensor plugin class
This commit is contained in:
parent
86754534ae
commit
35c5e2d8f7
1 changed files with 3 additions and 2 deletions
|
@ -2,9 +2,10 @@ import json
|
||||||
import serial
|
import serial
|
||||||
|
|
||||||
from platypush.plugins import Plugin, action
|
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
|
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
|
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()
|
return output.decode().strip()
|
||||||
|
|
||||||
@action
|
@action
|
||||||
def get_data(self):
|
def get_measurement(self):
|
||||||
"""
|
"""
|
||||||
Reads JSON data from the serial device and returns it as a message
|
Reads JSON data from the serial device and returns it as a message
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue