platypush.plugins.sensor

class platypush.plugins.sensor.SensorPlugin(**kwargs)[source]

Sensor abstract plugin. Any plugin that interacts with sensors should implement this class (and the get_measurement() method)

__init__(**kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

get_data(*args, **kwargs)[source]

Alias for get_measurement

get_measurement(*args, **kwargs)[source]

Implemented by the subclasses.

Returns:Either a raw scalar:

output = 273.16

or a name-value dictionary with the values that have been read:

output = {
    "temperature": 21.5,
    "humidity": 41.0
}

or a list of values:

[
    0.01,
    0.34,
    0.53,
    ...
]