Merge pull request #71 from lowdef/fix_ProfileGenericObject_for_telegram_iterator

add value and unit properties to ProfileGenericObject to make sure they do not break
This commit is contained in:
Nigel Dokter 2021-03-04 21:49:03 +01:00 committed by GitHub
commit e607b62fa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,6 +155,16 @@ class ProfileGenericObject(DSMRObject):
super().__init__(values)
self._buffer_list = None
@property
def value(self):
# value is added to make sure the telegram iterator does not break
return self.values
@property
def unit(self):
# value is added to make sure all items have a unit so code that relies on that does not break
return None
@property
def buffer_length(self):
return self.values[0]['value']