Sensor Extension
import sp
class Sensor_Plugin(sp.BaseSensorObject):
def __init__(self):
sp.BaseSensorObject.__init__(self)
if __name__ == "__main__":
sp.registerPlugin(Sensor_Plugin)
Main Class
The class name Sensor_Plugin can be customized and also represent the name of your Plugin.
class Sensor_Plugin(sp.BaseSensorObject):While (sp.BaseSensorObject) can´t be renamed.
Initialization
Within your Main Class it´s necessary to define a function for the initialization:
def __init__(self):
sp.BaseSensorObject.__init__(self)Register
To register the plugin you need the following lines of code outside of your Main Class:
if __name__ == "__main__":
sp.registerPlugin(Sensor_Plugin)Last updated