Skip to content

Commit

Permalink
Merge pull request sonic-net#132 from vdahiya12/adding_changes_for_ba…
Browse files Browse the repository at this point in the history
…se_api

[sonic_platform_base][fan_drawer_base] adding get_fan definition to the base api definitions of fan_drawer base class
  • Loading branch information
vdahiya12 authored Oct 14, 2020
2 parents ec9082e + d423ec5 commit a903ab9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions sonic_platform_base/fan_drawer_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,29 @@ def get_all_fans(self):
"""
return self._fan_list

def get_fan(self, index):
"""
Retrieves fan module represented by (0-based) index <index>
Args:
index: An integer, the index (0-based) of the fan module to
retrieve
Returns:
An object dervied from FanBase representing the specified fan
module
"""
fan = None

try:
fan = self._fan_list[index]
except IndexError:
sys.stderr.write("Fan index {} out of range (0-{})\n".format(
index, len(self._fan_list)-1))

return fan


def set_status_led(self, color):
"""
Sets the state of the fan drawer status LED
Expand Down

0 comments on commit a903ab9

Please sign in to comment.