[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/Garrison.py b/bin/Garrison.py
index 5564162..3f09836 100755
--- a/bin/Garrison.py
+++ b/bin/Garrison.py
@@ -608,3 +608,17 @@
}
},
}
+
+# Miscellaneous non-poll sensor with system specific properties.
+# The sensor id is the same as those defined in ID_LOOKUP['SENSOR'].
+MISC_SENSORS = {
+ 0x5f : { 'class' : 'BootCountSensor' },
+ 0x05 : { 'class' : 'BootProgressSensor' },
+ 0x08 : { 'class' : 'OccStatusSensor',
+ 'os_path' : '/sys/class/i2c-adapter/i2c-3/3-0050/online' },
+ 0x09 : { 'class' : 'OccStatusSensor',
+ 'os_path' : '/sys/class/i2c-adapter/i2c-3/3-0051/online' },
+ 0xb5 : { 'class' : 'OperatingSystemStatusSensor' },
+ 0xb3 : { 'class' : 'PowerCap',
+ 'os_path' : '/sys/class/hwmon/hwmon3/user_powercap' },
+}