This module provides the Sensor interface class.
class Sensor()
This class is the interface a Sensor should implement.
@abstractmethod
def read(**kwargs: dict) -> dict
Return a sensor record.
@abstractmethod
def units(**kwargs: dict) -> dict
Return the sensor unit mapping
class SensorReader(Sensor)
This class is sensor wrapper with error management.
It discharges the caller from having to handle various exceptions. On a sensor read() failure, the wrapper returns None. The caller can use the time_elapsed_since_latest_record() method to know the time elapsed since it successfully retrieved a record.
def read(**kwargs) -> dict
Read a sensor record.
It returns an empty dictionary if the sensor read() method raises an Pyro5.errors.CommunicationError or RuntimeError exception.
def time_elapsed_since_latest_record() -> timedelta
Time elapsed since read() successfully retrieved a record.