forked from platypush/platypush
GpioSensorDistancePlugin should extend GpioPlugin
This commit is contained in:
parent
b375c9dd9f
commit
4090570278
2 changed files with 4 additions and 4 deletions
|
@ -36,5 +36,5 @@ class GpioSensorPlugin(Plugin):
|
|||
|
||||
return self.get_measurement(*args, **kwargs).output
|
||||
|
||||
# vim:sw=4:ts=4:et:
|
||||
|
||||
# vim:sw=4:ts=4:et:
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import time
|
||||
|
||||
from platypush.plugins import action
|
||||
from platypush.plugins.gpio import GpioPlugin
|
||||
from platypush.plugins.gpio.sensor import GpioSensorPlugin
|
||||
|
||||
|
||||
class GpioSensorDistancePlugin(GpioSensorPlugin):
|
||||
class GpioSensorDistancePlugin(GpioPlugin, GpioSensorPlugin):
|
||||
"""
|
||||
You can use this plugin to interact with a distance sensor on your Raspberry
|
||||
Pi (tested with a HC-SR04 ultrasound sensor).
|
||||
|
@ -24,7 +25,7 @@ class GpioSensorDistancePlugin(GpioSensorPlugin):
|
|||
"""
|
||||
|
||||
import RPi.GPIO as gpio
|
||||
super().__init__(*args, **kwargs)
|
||||
GpioPlugin.__init__(self, *args, **kwargs)
|
||||
|
||||
self.trigger_pin = trigger_pin
|
||||
self.echo_pin = echo_pin
|
||||
|
@ -88,4 +89,3 @@ class GpioSensorDistancePlugin(GpioSensorPlugin):
|
|||
|
||||
|
||||
# vim:sw=4:ts=4:et:
|
||||
|
||||
|
|
Loading…
Reference in a new issue