mirror of
https://opendev.org/x/pyghmi
synced 2025-02-04 21:12:47 +00:00
Add missing class to generic redfish support
Change-Id: I4d9c2cb163ba0f8f3e4b1c878b1dec26ae8f7422
This commit is contained in:
parent
ec1720c862
commit
c0927c9f2e
@ -21,6 +21,25 @@ import pyghmi.constants as const
|
||||
import pyghmi.exceptions as exc
|
||||
import pyghmi.media as media
|
||||
|
||||
class SensorReading(object):
|
||||
def __init__(self, healthinfo, sensor=None, value=None, units=None,
|
||||
unavailable=False):
|
||||
if sensor:
|
||||
self.name = sensor['name']
|
||||
else:
|
||||
self.name = healthinfo['Name']
|
||||
self.health = _healthmap.get(healthinfo.get(
|
||||
'Status', {}).get('Health', None), const.Health.Warning)
|
||||
self.states = [healthinfo.get('Status', {}).get('Health',
|
||||
'Unknown')]
|
||||
self.health = _healthmap[healthinfo['Status']['Health']]
|
||||
self.states = [healthinfo['Status']['Health']]
|
||||
self.value = value
|
||||
self.state_ids = None
|
||||
self.imprecision = None
|
||||
self.units = units
|
||||
self.unavailable = unavailable
|
||||
|
||||
_healthmap = {
|
||||
'Critical': const.Health.Critical,
|
||||
'Unknown': const.Health.Warning,
|
||||
|
Loading…
x
Reference in New Issue
Block a user