summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2018-08-17 14:58:32 -0500
committerAdriana Kobylak <anoo@us.ibm.com>2018-08-21 11:15:05 -0500
commit6c22a7656eb1ef51d0391713a953c15bbcdd3526 (patch)
treeaae2e57fe4534bb30b3777db8afdfa54a4a05478
parentf63e191ca673a0acd7ab5c45272e1acf51bf7183 (diff)
downloadpyphosphor-6c22a7656eb1ef51d0391713a953c15bbcdd3526.tar.gz
pyphosphor-6c22a7656eb1ef51d0391713a953c15bbcdd3526.zip
sensors: Remove PowerSupplyRedundancySensor
The PowerSupplyRedundancy Sensor is being added to the ipmi sensor.yaml file since the /org/openbmc/sensors path is being deprecated. Remove this sensor from the org path. Tested: Powered on a Witherspoon to the Host OS without sensor errors. Change-Id: Ie5ad41e7723de67c665576d6a69210df82710869 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rw-r--r--obmc/sensors.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/obmc/sensors.py b/obmc/sensors.py
index 64eadef..49a4797 100644
--- a/obmc/sensors.py
+++ b/obmc/sensors.py
@@ -50,52 +50,6 @@ class VirtualSensor(SensorValue):
CONTROL_IFACE = 'org.openbmc.Control'
-class PowerSupplyRedundancySensor(VirtualSensor):
- def __init__(self, bus, name):
- VirtualSensor.__init__(self, bus, name)
- self.bus = bus
- self.bus_name = 'xyz.openbmc_project.Settings'
- self.obj_path = '/xyz/openbmc_project/control/power_supply_redundancy'
- self.iface = 'xyz.openbmc_project.Control.PowerSupplyRedundancy'
- self.prop_iface = 'org.freedesktop.DBus.Properties'
- self.property_name = 'PowerSupplyRedundancyEnabled'
- super(PowerSupplyRedundancySensor, self).setValue(self.getValue())
-
- # Override setValue method
- @dbus.service.method(
- SensorValue.IFACE_NAME, in_signature='v', out_signature='')
- def setValue(self, value):
- if (value == "Enabled"):
- intf = self.getPowerSupplyInterface()
- intf.Set(self.iface, self.property_name, True)
- elif (value == "Disabled"):
- intf = self.getPowerSupplyInterface()
- intf.Set(self.iface, self.property_name, False)
- else:
- print("Invalid Power Supply Redundancy value")
- return
- super(PowerSupplyRedundancySensor, self).setValue(value)
-
- # Override getValue method
- @dbus.service.method(
- SensorValue.IFACE_NAME, in_signature='', out_signature='v')
- def getValue(self):
- intf = self.getPowerSupplyInterface()
- value = intf.Get(self.iface, self.property_name)
- if (value == 1):
- return "Enabled"
- elif (value == 0):
- return "Disabled"
- else:
- print("Unable to determine Power Supply Redundancy value")
- return ""
-
- def getPowerSupplyInterface(self):
- obj = self.bus.get_object(self.bus_name, self.obj_path,
- introspect=True)
- return dbus.Interface(obj, self.prop_iface)
-
-
class PowerSupplyDeratingSensor(VirtualSensor):
def __init__(self, bus, name):
VirtualSensor.__init__(self, bus, name)
OpenPOWER on IntegriCloud