2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-15 12:17:44 +00:00

For unspecified sensors use None as the component

Rather than use the string 'Unspecified', use the
None object to denote an event that has no associated
component.

Change-Id: I8b8431257a01434ec09aaa940fab5bbce2164ae6
This commit is contained in:
Jarrod Johnson 2015-05-15 14:50:13 -04:00
parent 612c3fb303
commit 369463eb9f

View File

@ -382,7 +382,7 @@ class EventHandler(object):
event['component'] = self._sdr.sensors[eventdata[4]].name
except KeyError:
if eventdata[4] == 0:
event['component'] = 'Unspecified'
event['component'] = None
else:
event['component'] = 'Sensor {0}'.format(eventdata[4])
event['deassertion'] = (eventdata[5] & 0b10000000 == 0b10000000)