Add sensors function to wetboobs

This commit is contained in:
Florent 2013-01-10 14:56:34 +01:00
commit a04ac33d65

View file

@ -187,3 +187,17 @@ class WetBoobs(ReplApplication):
for backend, measure in self.do('get_last_measure', _id, backends=backend_name, caps=ICapGauge): for backend, measure in self.do('get_last_measure', _id, backends=backend_name, caps=ICapGauge):
self.format(measure) self.format(measure)
self.flush() self.flush()
def do_sensors(self, line):
"""
sensors GAUGE_ID
Iter sensors of a gauge.
"""
gauge, = self.parse_command_args(line, 1, 1)
_id, backend_name = self.parse_id(gauge)
self.start_format()
for backend, sensor in self.do('iter_sensors', _id, backends=backend_name, caps=ICapGauge):
self.format(sensor)
self.flush()