diff --git a/pyghmi/ipmi/oem/lenovo/energy.py b/pyghmi/ipmi/oem/lenovo/energy.py index 5957a031..93b627da 100644 --- a/pyghmi/ipmi/oem/lenovo/energy.py +++ b/pyghmi/ipmi/oem/lenovo/energy.py @@ -27,6 +27,15 @@ class EnergyManager(object): # We start with a 'find firmware instance' to test the water and # get the handle (which has always been the same, but just in case self.iana = bytearray(b'\x66\x4a\x00') + self._usefapm = False + try: + rsp = ipmicmd.xraw_command(netfn=0x3a, command=0x32, data=[4, 2, 0, 0, 0]) + self.supportedmeters = ('DC Energy',) + self._usefapm = True + return + except pygexc.IpmiException: + pass + try: rsp = ipmicmd.xraw_command(netfn=0x2e, command=0x82, data=self.iana + b'\x00\x00\x01') @@ -47,6 +56,12 @@ class EnergyManager(object): else: self.supportedmeters = ('DC Energy',) + def get_fapm_energy(self, ipmicmd): + rsp = ipmicmd.xraw_command(netfn=0x3a, command=0x32, data=[4, 2, 0, 0, 0]) + j, mj = struct.unpack('