Skip to content

Commit e5ed2ab

Browse files
authored
[psu_base] get_status_led() returns current state of the status LED (sonic-net#39)
1 parent 96188fc commit e5ed2ab

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

sonic_platform_base/fan_base.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class FanBase(device_base.DeviceBase):
2121

2222
# Possible fan status LED colors
2323
STATUS_LED_COLOR_GREEN = "green"
24+
STATUS_LED_COLOR_AMBER = "amber"
2425
STATUS_LED_COLOR_RED = "red"
2526
STATUS_LED_COLOR_OFF = "off"
2627

@@ -89,3 +90,12 @@ def set_status_led(self, color):
8990
bool: True if status LED state is set successfully, False if not
9091
"""
9192
raise NotImplementedError
93+
94+
def get_status_led(self):
95+
"""
96+
Gets the state of the fan status LED
97+
98+
Returns:
99+
A string, one of the predefined STATUS_LED_COLOR_* strings above
100+
"""
101+
raise NotImplementedError

sonic_platform_base/psu_base.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class PsuBase(device_base.DeviceBase):
1717

1818
# Possible fan status LED colors
1919
STATUS_LED_COLOR_GREEN = "green"
20+
STATUS_LED_COLOR_AMBER = "amber"
2021
STATUS_LED_COLOR_RED = "red"
2122
STATUS_LED_COLOR_OFF = "off"
2223

@@ -116,14 +117,11 @@ def set_status_led(self, color):
116117
"""
117118
raise NotImplementedError
118119

119-
def get_status_led(self, color):
120+
def get_status_led(self):
120121
"""
121122
Gets the state of the PSU status LED
122123
123-
Args:
124-
color: A string representing the color of PSU status LED
125-
126124
Returns:
127-
bool: True if get LED state returned successfully, False if not
125+
A string, one of the predefined STATUS_LED_COLOR_* strings above
128126
"""
129127
raise NotImplementedError

0 commit comments

Comments
 (0)