Sensor reading support for Power Supply Redundancy
Added Power Supply Redundancy Sensor and prevented
setting the value.
Change-Id: If05ecb74c1e05ac59da1ae4dbb265ba65ce7744b
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
diff --git a/obmc/sensors.py b/obmc/sensors.py
index dc74733..d3faef9 100644
--- a/obmc/sensors.py
+++ b/obmc/sensors.py
@@ -295,3 +295,14 @@
def SystemStateHandler(self, state):
if (state == "HOST_POWERED_OFF"):
self.setValue("Off")
+
+class PowerSupplyRedundancySensor(VirtualSensor):
+ def __init__(self, bus, name):
+ VirtualSensor.__init__(self, bus, name)
+ super(PsRedundancySensor,self).setValue("Disabled")
+
+ ## override setValue method
+ @dbus.service.method(
+ SensorValue.IFACE_NAME, in_signature='v', out_signature='')
+ def setValue(self, value):
+ print "Setting Power Supply Redundancy is not allowed"