mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-20 20:09:11 +00:00
hwmon: move sensor discovery into initialize()
It only needs to be done once per run.
This commit is contained in:
parent
f504fc8791
commit
7a86a1b17f
@ -82,13 +82,15 @@ class HwmonInstrument(Instrument):
|
||||
|
||||
self.sensors = []
|
||||
|
||||
def setup(self, context):
|
||||
def initialize(self, context):
|
||||
self.sensors = []
|
||||
self.logger.debug('Searching for HWMON sensors.')
|
||||
discovered_sensors = discover_sensors(self.device, self.sensor_kinds.keys())
|
||||
for sensor in sorted(discovered_sensors, key=lambda s: HWMON_SENSOR_PRIORITIES.index(s.kind)):
|
||||
self.logger.debug('Adding {}'.format(sensor.filepath))
|
||||
self.sensors.append(sensor)
|
||||
|
||||
def setup(self, context):
|
||||
for sensor in self.sensors:
|
||||
sensor.clear_readings()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user