mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 18:21:14 +00:00
hwmon: Added allowed values to sensors
parameter
Previously the sensor name was just appeneded to the end of the previous sensors name.
This commit is contained in:
parent
ef61f16896
commit
87cbce4244
@ -64,6 +64,7 @@ class HwmonInstrument(Instrument):
|
||||
parameters = [
|
||||
Parameter('sensors', kind=list_of_strs, default=['energy', 'temp'],
|
||||
global_alias='hwmon_sensors',
|
||||
allowed_values=HWMON_SENSORS.keys(),
|
||||
description='The kinds of sensors hwmon instrument will look for')
|
||||
]
|
||||
|
||||
@ -73,11 +74,7 @@ class HwmonInstrument(Instrument):
|
||||
if self.sensors:
|
||||
self.sensor_kinds = {}
|
||||
for kind in self.sensors:
|
||||
if kind in HWMON_SENSORS:
|
||||
self.sensor_kinds[kind] = HWMON_SENSORS[kind]
|
||||
else:
|
||||
message = 'Unexpected sensor type: {}; must be in {}'.format(kind, HWMON_SENSORS.keys())
|
||||
raise ConfigError(message)
|
||||
else:
|
||||
self.sensor_kinds = HWMON_SENSORS
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user