Skip to content

Commit 9f3be44

Browse files
[chassis_base] Add platform API support for system LED (sonic-net#91)
Why I did this? To support system health feature, we need get/set system LED status. How I did this? Add 2 new platform API to chassis_base.py for vendor to implement: - set_status_led - get_status_led
1 parent 3d94a59 commit 9f3be44

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

sonic_platform_base/chassis_base.py

+30
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ class ChassisBase(device_base.DeviceBase):
6060
# Object derived from eeprom_tlvinfo.TlvInfoDecoder indicating the eeprom on the chassis
6161
_eeprom = None
6262

63+
# System status LED
64+
_status_led = None
65+
6366
def __init__(self):
6467
self._component_list = []
6568
self._module_list = []
@@ -433,6 +436,33 @@ def get_sfp(self, index):
433436

434437
return sfp
435438

439+
##############################################
440+
# System LED methods
441+
##############################################
442+
443+
def set_status_led(self, color):
444+
"""
445+
Sets the state of the system LED
446+
447+
Args:
448+
color: A string representing the color with which to set the
449+
system LED
450+
451+
Returns:
452+
bool: True if system LED state is set successfully, False if not
453+
"""
454+
raise NotImplementedError
455+
456+
def get_status_led(self):
457+
"""
458+
Gets the state of the system LED
459+
460+
Returns:
461+
A string, one of the valid LED color strings which could be vendor
462+
specified.
463+
"""
464+
raise NotImplementedError
465+
436466
##############################################
437467
# Other methods
438468
##############################################

0 commit comments

Comments
 (0)