Skip to content

Commit

Permalink
[Author]:[email protected] [Jira ID]:N/A [Description]:fix the t…
Browse files Browse the repository at this point in the history
…hermal API testbed issues
  • Loading branch information
nicwu-cel committed Apr 12, 2022
1 parent 38fce5f commit 84c953b
Showing 1 changed file with 98 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,102 @@ class Thermal(PddfThermal):

def __init__(self, index, pddf_data=None, pddf_plugin_data=None):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data)

self.minimum_thermal = self.get_temperature()
self.maximum_thermal = self.get_temperature()
# Provide the functions/variables below for which implementation is to be overwritten

def get_low_critical_threshold(self):
"""
Retrieves the low critical threshold temperature of thermal
Returns:
A float number, the low critical threshold temperature of thermal in Celsius
up to nearest thousandth of one degree Celsius, e.g. 30.125
"""
return 0.001

def get_high_critical_threshold(self):
"""
Retrieves the high critical threshold temperature of thermal
Returns:
A float number, the high critical threshold temperature of thermal in Celsius
up to nearest thousandth of one degree Celsius, e.g. 30.125
"""

return 100.000

def get_minimum_recorded(self):
"""
Retrieves the minimum recorded temperature of thermal
Returns:
A float number, the minimum recorded temperature of thermal in Celsius
up to nearest thousandth of one degree Celsius, e.g. 30.125
"""
tmp = self.get_temperature()
if tmp < self.minimum_thermal:
self.minimum_thermal = tmp

return self.minimum_thermal

def get_maximum_recorded(self):
"""
Retrieves the maximum recorded temperature of thermal
Returns:
A float number, the maximum recorded temperature of thermal in Celsius
up to nearest thousandth of one degree Celsius, e.g. 30.125
"""
tmp = self.get_temperature()
if tmp > self.maximum_thermal:
self.maximum_thermal = tmp

return self.maximum_thermal

def get_presence(self):
"""
Retrieves the presence of the PSU
Returns:
bool: True if Thermal is present, False if not
"""
return True

def get_model(self):
"""
Retrieves the model number (or part number) of the device
Returns:
string: Model/part number of device
"""
return "N/A"

def get_serial(self):
"""
Retrieves the serial number of the device
Returns:
string: Serial number of device
"""
return "N/A"

def get_status(self):
"""
Retrieves the operational status of the device
Returns:
A boolean value, True if device is operating properly, False if not
"""
if not self.get_presence():
return False

return True

def is_replaceable(self):
"""
Retrieves whether thermal module is replaceable
Returns:
A boolean value, True if replaceable, False if not
"""
return False

def get_position_in_parent(self):
"""
Retrieves the thermal position information
Returns:
A int value, 0 represent ASIC thermal, 1 represent CPU thermal info
"""
return 0

0 comments on commit 84c953b

Please sign in to comment.