[skeleton]: Fix hard-coded path name when creating sensor object
This patch fixes skeleton issue: https://github.com/openbmc/skeleton/issues/33
The non-poll sensors have system specific properties. Define the sensor properties
in System files, and generate sensor object dynamically.
diff --git a/bin/Palmetto.py b/bin/Palmetto.py
index 09fbe06..4c23068 100755
--- a/bin/Palmetto.py
+++ b/bin/Palmetto.py
@@ -306,3 +306,15 @@
}
}
}
+
+# Miscellaneous non-poll sensor with system specific properties.
+# The sensor id is the same as those defined in ID_LOOKUP['SENSOR'].
+MISC_SENSORS = {
+ 0x09 : { 'class' : 'BootCountSensor' },
+ 0x05 : { 'class' : 'BootProgressSensor' },
+ 0x08 : { 'class' : 'OccStatusSensor',
+ 'os_path' : '/sys/class/i2c-adapter/i2c-3/3-0050/online' },
+ 0x32 : { 'class' : 'OperatingSystemStatusSensor' },
+ 0x33 : { 'class' : 'PowerCap',
+ 'os_path' : '/sys/class/hwmon/hwmon1/user_powercap' },
+}