add value and unit properties to ProfileGenericObject to make sure that code like iterators that rely on that do not break

This commit is contained in:
Hans Erik van Elburg 2021-01-03 19:58:19 +01:00
parent 3dc77a8231
commit 804747c370

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.__str__()
@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']