1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-09-23 12:21:54 +01:00

InstrumentChannel: name is now an alias for label

In addition to a label constructed form the combination of site and
measurment type, channels had a name that was specified on creation.
This proven to be not particularly useful (there only being one instance
of the name being set to something materially different from the label);
and this has lead to channels being inconsistenly referenced (some times
a channel is identified by its label, and sometimes by the name).

This commit removes the name from __init__ arguments, and
InstrumentChannel.name is now an alias for InstrumentChannel.label.
This commit is contained in:
Sergei Trofimov
2017-08-31 17:38:33 +01:00
parent 823ce718bf
commit 9192deb8ee
3 changed files with 23 additions and 26 deletions

View File

@@ -45,7 +45,7 @@ class HwmonInstrument(Instrument):
measure = self.measure_map.get(ts.kind)[0]
if measure:
self.logger.debug('\tAdding sensor {}'.format(ts.name))
self.add_channel(_guess_site(ts), measure, name=ts.name, sensor=ts)
self.add_channel(_guess_site(ts), measure, sensor=ts)
else:
self.logger.debug('\tSkipping sensor {} (unknown kind "{}")'.format(ts.name, ts.kind))
except ValueError: