Skip to content

Commit

Permalink
DellEMC: Z9332f update PSU threshold (#7832)
Browse files Browse the repository at this point in the history
#### Why I did it
Updated Z9332f PSU threshold values.

#### How I did it
Fetch the PSU voltage and temperature threshold via ipmitool
  • Loading branch information
aravindmani-1 committed Jun 17, 2021
1 parent 0f99f97 commit b3e8b57
Showing 1 changed file with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ class Psu(PsuBase):

# { PSU-ID: { Sensor-Name: Sensor-ID } }
SENSOR_MAPPING = { 1: { "State": 0x2f, "Current": 0x37,
"Power": 0x38, "Voltage": 0x36,
"Power": 0x38, "Voltage": 0x36,
"Temperature": 0x35 },
2: { "State": 0x39, "Current": 0x41,
"Power": 0x42, "Voltage": 0x40,
"Power": 0x42, "Voltage": 0x40,
"Temperature": 0x3F } }

# ( PSU-ID: FRU-ID }
FRU_MAPPING = { 1: 3, 2: 4 }

Expand Down Expand Up @@ -119,13 +120,24 @@ def get_voltage_low_threshold(self):
"""
Returns PSU low threshold in Volts
"""
return 11.4
is_valid, low_threshold = self.voltage_sensor.get_threshold("LowerCritical")
if not is_valid:
low_threshold = 11.4
low_threshold = "{:.2f}".format(low_threshold)

return float(low_threshold)


def get_voltage_high_threshold(self):
"""
Returns PSU high threshold in Volts
"""
return 12.6
is_valid, high_threshold = self.voltage_sensor.get_threshold("UpperCritical")
if not is_valid:
high_threshold = 12.6
high_threshold = "{:.2f}".format(high_threshold)

return float(high_threshold)

def get_temperature(self):
"""
Expand All @@ -145,7 +157,13 @@ def get_temperature_high_threshold(self):
"""
Returns the high temperature threshold for PSU in Celsius
"""
return 45.0
is_valid, high_threshold = self.temp_sensor.get_threshold("UpperCritical")
if not is_valid:
high_threshold = 113
high_threshold = "{:.2f}".format(high_threshold)

return float(high_threshold)


def get_current(self):
"""
Expand Down

0 comments on commit b3e8b57

Please sign in to comment.