diff options
author | Dhruvaraj S <dhruvaraj@in.ibm.com> | 2017-03-21 02:13:29 -0500 |
---|---|---|
committer | Dhruvaraj S <dhruvaraj@in.ibm.com> | 2017-03-27 03:51:15 -0500 |
commit | dc0dc12bc812278c4a1d1ced740fed17ae3495db (patch) | |
tree | 1b5a0bd6ff2be2f68a84ebaaec2c5c56d500cd88 | |
parent | 57e3bf965d731ac52f59497a6247a1d80d1bc0a0 (diff) | |
download | pyphosphor-dc0dc12bc812278c4a1d1ced740fed17ae3495db.tar.gz pyphosphor-dc0dc12bc812278c4a1d1ced740fed17ae3495db.zip |
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>
-rw-r--r-- | obmc/sensors.py | 11 |
1 files changed, 11 insertions, 0 deletions
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 @@ class OperatingSystemStatusSensor(VirtualSensor): 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" |