Skip to content

Commit

Permalink
[chassis_base] Add platform API support for system LED (sonic-net#91)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junchao-Mellanox authored Jun 10, 2020
1 parent 3d94a59 commit 9f3be44
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions sonic_platform_base/chassis_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class ChassisBase(device_base.DeviceBase):
# Object derived from eeprom_tlvinfo.TlvInfoDecoder indicating the eeprom on the chassis
_eeprom = None

# System status LED
_status_led = None

def __init__(self):
self._component_list = []
self._module_list = []
Expand Down Expand Up @@ -433,6 +436,33 @@ def get_sfp(self, index):

return sfp

##############################################
# System LED methods
##############################################

def set_status_led(self, color):
"""
Sets the state of the system LED
Args:
color: A string representing the color with which to set the
system LED
Returns:
bool: True if system LED state is set successfully, False if not
"""
raise NotImplementedError

def get_status_led(self):
"""
Gets the state of the system LED
Returns:
A string, one of the valid LED color strings which could be vendor
specified.
"""
raise NotImplementedError

##############################################
# Other methods
##############################################
Expand Down

0 comments on commit 9f3be44

Please sign in to comment.