mirror of
https://opendev.org/x/pyghmi
synced 2025-01-27 19:37:44 +00:00
Provide more consistent attributes
When an reading is unavialable, a distinct set of attributes were available. Correct this by at least having the same attributes available. Change-Id: I9fc351d804f638a2535a2c9be9d9e9929f2be6ba
This commit is contained in:
parent
17fe93826f
commit
69d786c151
@ -193,6 +193,8 @@ class SensorReading(object):
|
||||
self.value = None
|
||||
self.imprecision = None
|
||||
self.states = []
|
||||
self.state_ids = []
|
||||
self.unavailable = 0
|
||||
try:
|
||||
self.health = reading['health']
|
||||
self.states = reading['states']
|
||||
@ -215,6 +217,7 @@ class SensorReading(object):
|
||||
'imprecision': self.imprecision,
|
||||
'name': self.name,
|
||||
'type': self.type,
|
||||
'unavailable': self.unavailable,
|
||||
'health': self.health
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user