From 4826c58fb184cfe62ed767d47e97cfd86770788f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 29 Apr 2025 16:33:50 -0400 Subject: [PATCH] Add SMM3 identify light manipulation The SMM3 owing to not having a 'System' places identify in an Oem location. Change-Id: I741991a92c701ff951eaff91f2e7d26a6211875d --- pyghmi/redfish/command.py | 2 ++ pyghmi/redfish/oem/lenovo/smm3.py | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index b88ad8e3..67eec1a0 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -846,6 +846,8 @@ class Command(object): self._do_web_request(url, {'ResetType': action}) def set_identify(self, on=True, blink=None): + if hasattr(self.oem, 'set_identify'): + return self.oem.set_identify(on, blink) targurl = self.sysurl if not targurl: root = self._do_web_request('/redfish/v1') diff --git a/pyghmi/redfish/oem/lenovo/smm3.py b/pyghmi/redfish/oem/lenovo/smm3.py index 491e8bec..5c9491d6 100644 --- a/pyghmi/redfish/oem/lenovo/smm3.py +++ b/pyghmi/redfish/oem/lenovo/smm3.py @@ -62,6 +62,19 @@ class OEMHandler(generic.OEMHandler): health = healthlookup.get(health, pygconst.Health.Critical) return {'health': health} + def set_identify(self, on=True, blink=False): + if on: + state = 'On' + elif blink: + state = 'Blinking' + else: + state = 'Off' + self._do_web_request('/redfish/v1/Chassis/chassis1', { + 'Oem': {'Lenovo': {'LED': {'IdentifyLED': { + 'State': state + }}} + }}, method='PATCH') + def get_system_configuration(self, hideadvanced=True, fishclient=None): return {}