Skip to content
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
20 changes: 20 additions & 0 deletions device/arista/x86_64-arista_7050_qx32/plugins/led_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,26 @@ def port_link_state_change(self, port, state):

# Constructor
def __init__(self):
# Initialize all front-panel status LEDs to green
with open("/sys/class/leds/status/brightness", "w") as f:
f.write("1")
with open("/sys/class/leds/fan_status/brightness", "w") as f:
f.write("1")
with open("/sys/class/leds/psu1/brightness", "w") as f:
f.write("1")
with open("/sys/class/leds/psu2/brightness", "w") as f:
f.write("1")

# Initialize all fan LEDs to green
with open("/sys/devices/platform/sb800-fans/hwmon/hwmon1/fan1_led", "w") as f:
f.write("3")
with open("/sys/devices/platform/sb800-fans/hwmon/hwmon1/fan2_led", "w") as f:
f.write("3")
with open("/sys/devices/platform/sb800-fans/hwmon/hwmon1/fan3_led", "w") as f:
f.write("3")
with open("/sys/devices/platform/sb800-fans/hwmon/hwmon1/fan4_led", "w") as f:
f.write("3")

# Initialize: Turn all front panel QSFP LEDs off
for qsfp_index in range(self.QSFP_BREAKOUT_START_IDX, self.QSFP_BREAKOUT_END_IDX + 1):
for lane in range(1, 5):
Expand Down
21 changes: 21 additions & 0 deletions device/arista/x86_64-arista_7050_qx32s/plugins/led_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@ def port_link_state_change(self, port, state):

# Constructor
def __init__(self):
# Initialize all front-panel status LEDs to green
with open("/sys/class/leds/status/brightness", "w") as f:
f.write("1")
with open("/sys/class/leds/fan_status/brightness", "w") as f:
f.write("1")
with open("/sys/class/leds/psu1/brightness", "w") as f:
f.write("1")
with open("/sys/class/leds/psu2/brightness", "w") as f:
f.write("1")

# Initialize all fan LEDs to green
with open("/sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/i2c-3/3-0060/hwmon/hwmon2/fan1_led", "w") as f:
f.write("1")
with open("/sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/i2c-3/3-0060/hwmon/hwmon2/fan2_led", "w") as f:
f.write("1")
with open("/sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/i2c-3/3-0060/hwmon/hwmon2/fan3_led", "w") as f:
f.write("1")
with open("/sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/i2c-3/3-0060/hwmon/hwmon2/fan4_led", "w") as f:
f.write("1")


# Initialize: Turn all front panel QSFP LEDs off
for qsfp_index in range(self.QSFP_BREAKOUT_START_IDX, self.QSFP_BREAKOUT_END_IDX + 1):
for lane in range(1, 5):
Expand Down