Merge pull request #65 from bradbishop/occ-sensor-path
Allow sysfs path to be passed to OCC sensor
diff --git a/bin/Sensors.py b/bin/Sensors.py
index f951eeb..8350774 100755
--- a/bin/Sensors.py
+++ b/bin/Sensors.py
@@ -176,9 +176,12 @@
pass
class OccStatusSensor(VirtualSensor):
- def __init__(self,bus,name):
+ def __init__(self,bus,name, sysfs = None):
## default path. can be override
- self.sysfs_attr = "/sys/class/i2c-adapter/i2c-3/3-0050/online"
+ if sysfs is None:
+ self.sysfs_attr = "/sys/class/i2c-adapter/i2c-3/3-0050/online"
+ else:
+ self.sysfs_attr = sysfs
VirtualSensor.__init__(self,bus,name)
self.setValue("Disabled")
bus.add_signal_receiver(self.SystemStateHandler,signal_name = "GotoSystemState")