[Edgecore][AS5835-54T] Read the data when the PSU is in the power-good state.

This commit is contained in:
roger530-ho 2023-08-14 08:45:14 +00:00
parent 73db51655e
commit 278a02d098
No known key found for this signature in database
GPG Key ID: 9BFB0185DB2A8016

View File

@ -72,3 +72,68 @@ class Psu(PddfPsu):
string: Revision value of device string: Revision value of device
""" """
return 'N/A' return 'N/A'
def get_model(self):
"""
Retrieves the model number (or part number) of the device
Returns:
string: Model/part number of device
"""
model = super().get_model()
if model and model.strip() == "":
return None
return model
def get_serial(self):
"""
Retrieves the serial number of the device
Returns:
string: Serial number of device
"""
serial = super().get_serial()
if serial and serial.strip() == "":
return None
return serial
def get_voltage(self):
"""
Retrieves current PSU voltage output
Returns:
A float number, the output voltage in volts,
e.g. 12.1
"""
if self.get_status() is not True:
return 0.0
return super().get_voltage()
def get_current(self):
"""
Retrieves present electric current supplied by PSU
Returns:
A float number, electric current in amperes,
e.g. 15.4
"""
if self.get_status() is not True:
return 0.0
return super().get_current()
def get_power(self):
"""
Retrieves current energy supplied by PSU
Returns:
A float number, the power in watts,
e.g. 302.6
"""
if self.get_status() is not True:
return 0.0
return super().get_power()