Skip to content

Commit

Permalink
Fix to show psu-fan dir when no power
Browse files Browse the repository at this point in the history
  • Loading branch information
jostar-yang committed Oct 17, 2022
1 parent 0b5a6a9 commit 14a0d72
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ def get_direction(self):
A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST
depending on fan direction
"""
if self.get_status() == False:
return None

if not self.is_psu_fan:
val = self.__read_txt_file(
CPLD_I2C_PATH + str(self.fan_tray_index+1) + "_direction")
Expand Down Expand Up @@ -179,7 +182,7 @@ def get_status_led(self):
Returns:
A string, one of the predefined STATUS_LED_COLOR_* strings above
"""
status=self.get_presence()
status=self.get_status()
if status is None:
return self.STATUS_LED_COLOR_OFF

Expand Down

0 comments on commit 14a0d72

Please sign in to comment.