From 804747c3703d93f73e54b3b7a166d28bfd6efd49 Mon Sep 17 00:00:00 2001 From: Hans Erik van Elburg Date: Sun, 3 Jan 2021 19:58:19 +0100 Subject: [PATCH 1/2] add value and unit properties to ProfileGenericObject to make sure that code like iterators that rely on that do not break --- dsmr_parser/objects.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dsmr_parser/objects.py b/dsmr_parser/objects.py index 4cd987d..dcadfce 100644 --- a/dsmr_parser/objects.py +++ b/dsmr_parser/objects.py @@ -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'] From 8c861ee308092368690a1d9e23a67b0197d2346b Mon Sep 17 00:00:00 2001 From: Hans Erik van Elburg Date: Sun, 14 Feb 2021 22:08:35 +0100 Subject: [PATCH 2/2] resolved comment --- dsmr_parser/objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsmr_parser/objects.py b/dsmr_parser/objects.py index dcadfce..c062d9d 100644 --- a/dsmr_parser/objects.py +++ b/dsmr_parser/objects.py @@ -158,7 +158,7 @@ class ProfileGenericObject(DSMRObject): @property def value(self): # value is added to make sure the telegram iterator does not break - return self.__str__() + return self.values @property def unit(self):