From e5ed2aba1e6ddd3827ed6eff26589cd204eb98b5 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Mon, 15 Jul 2019 10:51:57 -0700 Subject: [PATCH] [psu_base] get_status_led() returns current state of the status LED (#39) --- sonic_platform_base/fan_base.py | 10 ++++++++++ sonic_platform_base/psu_base.py | 8 +++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/sonic_platform_base/fan_base.py b/sonic_platform_base/fan_base.py index 2c2411c49..7ce8c5f75 100644 --- a/sonic_platform_base/fan_base.py +++ b/sonic_platform_base/fan_base.py @@ -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" @@ -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 diff --git a/sonic_platform_base/psu_base.py b/sonic_platform_base/psu_base.py index d21ca4104..adb1a6051 100644 --- a/sonic_platform_base/psu_base.py +++ b/sonic_platform_base/psu_base.py @@ -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" @@ -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