Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[psu_base] get_status_led() returns current state of the status LED #39

Merged
merged 2 commits into from
Jul 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sonic_platform_base/fan_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class FanBase(device_base.DeviceBase):

# Possible fan status LED colors
STATUS_LED_COLOR_GREEN = "green"
STATUS_LED_COLOR_AMBER = "amber"
STATUS_LED_COLOR_RED = "red"
STATUS_LED_COLOR_OFF = "off"

Expand Down Expand Up @@ -89,3 +90,12 @@ def set_status_led(self, color):
bool: True if status LED state is set successfully, False if not
"""
raise NotImplementedError

def get_status_led(self):
"""
Gets the state of the fan status LED

Returns:
A string, one of the predefined STATUS_LED_COLOR_* strings above
"""
raise NotImplementedError
8 changes: 3 additions & 5 deletions sonic_platform_base/psu_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class PsuBase(device_base.DeviceBase):

# Possible fan status LED colors
STATUS_LED_COLOR_GREEN = "green"
STATUS_LED_COLOR_AMBER = "amber"
STATUS_LED_COLOR_RED = "red"
STATUS_LED_COLOR_OFF = "off"

Expand Down Expand Up @@ -116,14 +117,11 @@ def set_status_led(self, color):
"""
raise NotImplementedError

def get_status_led(self, color):
def get_status_led(self):
"""
Gets the state of the PSU status LED

Args:
color: A string representing the color of PSU status LED

Returns:
bool: True if get LED state returned successfully, False if not
A string, one of the predefined STATUS_LED_COLOR_* strings above
"""
raise NotImplementedError