[Edgecore][AS7816-64X] Read the data when the PSU is in the power-good state.
This commit is contained in:
parent
033d3c39ae
commit
47bf7acaf5
@ -45,3 +45,68 @@ class Psu(PddfPsu):
|
||||
pass
|
||||
|
||||
return threshold
|
||||
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user