ProfileGeneric parser working, TODO complete ProfileGenericObject + Test

This commit is contained in:
Hans Erik van Elburg
2020-05-16 16:31:26 +02:00
parent a0ce89054a
commit b6278a8991
5 changed files with 70 additions and 40 deletions

View File

@@ -74,7 +74,7 @@ class MBusObject(DSMRObject):
# TODO object, but let the parse set them differently? So don't use
# TODO hardcoded indexes here.
if len(self.values) != 2: # v2
return self.values[5]['value']
return self.values[6]['value']
else:
return self.values[1]['value']
@@ -84,7 +84,7 @@ class MBusObject(DSMRObject):
# TODO object, but let the parse set them differently? So don't use
# TODO hardcoded indexes here.
if len(self.values) != 2: # v2
return self.values[4]['value']
return self.values[5]['value']
else:
return self.values[1]['unit']
@@ -111,5 +111,7 @@ class CosemObject(DSMRObject):
return output
class ProfileGeneric(DSMRObject):
pass # TODO implement
class ProfileGenericObject(DSMRObject):
def __str__(self):
output = "{}".format(self.values)
return output