From 88c0f7b451c744758d797f1ddb3341bb6016bde1 Mon Sep 17 00:00:00 2001 From: luyf5 Date: Mon, 13 Sep 2021 10:01:13 +0800 Subject: [PATCH] Support led for ts460 https: //gitlab.icelab.lenovo.com/pygcon/pyghmi/commit/e7f254a39c6396b41a54c48cf6467ce9a6631d5a to fix defect 67045, add led info for ts460 in v121 Change-Id: Ie7212a8a53f216d932ecf14b9d41b37eba314f9b --- pyghmi/ipmi/oem/lenovo/handler.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index 5930a713..6874b7f5 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -132,6 +132,15 @@ asrock_leds = { "LED_FAN_FAULT_3": 0x04 } +ts460_leds = { + "SYSTEM_EVENT": 0x00, + "BMC_UID": 0x01, + "LED_FAN_FAULT_1": 0x02, + "LED_FAN_FAULT_2": 0x03, + "LED_FAN_CPU": 0x04, + "LED_FAN_REAR": 0x05 +} + asrock_led_status = { 0x00: "Off", 0x01: "On" @@ -441,6 +450,12 @@ class OEMHandler(generic.OEMHandler): return True return False + @property + def isTS460(self): + if self.oemid['product_id'] == 1184: + return True + return False + def get_oem_inventory_descriptions(self): if self.has_tsm or self.has_asrock: # Thinkserver with TSM @@ -602,7 +617,11 @@ class OEMHandler(generic.OEMHandler): asrock = self.has_asrock if asrock: cmd = 0x50 - led_set = asrock_leds + # because rs160 has different led info with ts460 + if self.isTS460: + led_set = ts460_leds + else: + led_set = asrock_leds led_set_status = asrock_led_status for (name, id_) in led_set.items():