def get_oem_sensor_reading(self, name, ipmicmd): if self._energymanager is None: self._energymanager = energy.EnergyManager(ipmicmd) if name == 'AC Energy': kwh = self._energymanager.get_ac_energy(ipmicmd) elif name == 'DC Energy': kwh = self._energymanager.get_dc_energy(ipmicmd) else: raise pygexc.UnsupportedFunctionality('No sunch sensor ' + name) return sdr.SensorReading({'name': name, 'imprecision': None, 'value': kwh, 'states': [], 'state_ids': [], 'health': pygconst.Health.Ok, 'type': 'Energy'}, 'kWh')
def get_oem_sensor_names(self, ipmicmd): if self._energymanager is None: self._energymanager = energy.EnergyManager(ipmicmd) return self._energymanager.supportedmeters