ajenti.api.sensors

class ajenti.api.sensors.Sensor[source]

Base class for a Sensor. Sensors measure system status parameters and can be queried from other plugins.

static find(id)[source]

Returns a Sensor by name

Parameters:id (str) – sensor ID
Return type:Sensor, None
get_variants()[source]

Override this and return a list of available variants.

Return type:list
id = None
init()[source]
measure(variant=None)[source]

Override this and perform the measurement.

Parameters:variant (str, None) – variant to measure
Return type:int, float, tuple, list, dict, str
timeout = 0
value(variant=None)[source]

Returns sensor’s measurement for a specific variant. Sensors can have multiple variants; for example, disk usage sensor accepts device name as a variant.

Parameters:variant (str, None) – variant to measure
Return type:int, float, tuple, list, dict, str
comments powered by Disqus