diff --git a/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/psu.py b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/psu.py index 297cbb501da..632dae52de4 100644 --- a/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/psu.py +++ b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/psu.py @@ -72,6 +72,9 @@ def get_voltage(self): A float number, the output voltage in volts, e.g. 12.1 """ + if self.get_status() is not True: + return 0 + vout_path = "{}{}".format(self.hwmon_path, 'psu_v_out') vout_val=self._api_helper.read_txt_file(vout_path) if vout_val is not None: @@ -85,6 +88,9 @@ def get_current(self): Returns: A float number, the electric current in amperes, e.g 15.4 """ + if self.get_status() is not True: + return 0 + iout_path = "{}{}".format(self.hwmon_path, 'psu_i_out') val=self._api_helper.read_txt_file(iout_path) if val is not None: @@ -98,6 +104,9 @@ def get_power(self): Returns: A float number, the power in watts, e.g. 302.6 """ + if self.get_status() is not True: + return 0 + pout_path = "{}{}".format(self.hwmon_path, 'psu_p_out') val=self._api_helper.read_txt_file(pout_path) if val is not None: