pashehnet.sensors.sensor#
Module Contents#
Classes#
Wrapper class for source, transform(s) and formatting of sensor data, implemented as an iterator. Applies transforms and formatter to values provided by source. |
API#
- class pashehnet.sensors.sensor.Sensor(id, source, format, transforms=[], frequency=1)#
Bases:
objectWrapper class for source, transform(s) and formatting of sensor data, implemented as an iterator. Applies transforms and formatter to values provided by source.
Initialization
Construct new object
- Parameters:
id – the unique ID of this sensor
source – Source object, subclass of SensorSourceBase
format – Format object, subclass of SensorFormatBase
transforms – One or more transforms in order to be called, subclasses of SensorTransformBase
freq – Frequency of signal in Hz
- __iter__()#
Implementation for iterator
- Returns:
Self
- __next__()#
Implementation for iterator
- Returns:
Next value from sensor stream