sensors_base
frog.hardware.plugins.sensors.sensors_base
¤
Provides a base class for communicating sensor readings.
Attributes¤
Classes¤
SensorsBase(poll_interval=float('nan'))
¤
Bases: Device
Base device class for sensors devices.
These devices can be polled with the request_readings() method and should respond by calling send_readings_message() with new sensor values (at some point).
Create a new SensorsBase.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
poll_interval
|
float
|
How often to poll the sensor device (seconds). If set to nan, the device will only be polled once on device open |
float('nan')
|
Source code in frog/hardware/plugins/sensors/sensors_base.py
26 27 28 29 30 31 32 33 34 35 36 37 |
|
Functions¤
close()
¤
Close the device.
Source code in frog/hardware/plugins/sensors/sensors_base.py
52 53 54 55 |
|
request_readings()
abstractmethod
¤
Request new sensor readings from the device.
Source code in frog/hardware/plugins/sensors/sensors_base.py
44 45 46 |
|
send_readings_message(readings)
¤
Send a pubsub message containing new readings from the sensors.
Source code in frog/hardware/plugins/sensors/sensors_base.py
48 49 50 |
|
start_polling()
¤
Begin polling the device.
Source code in frog/hardware/plugins/sensors/sensors_base.py
39 40 41 42 |
|