referring to parent method from _parse_values in ProfileGenericParser

This commit is contained in:
albert 2020-09-08 12:30:51 +02:00
parent be4386bc59
commit dc902a83e9

View File

@ -225,8 +225,11 @@ class ProfileGenericParser(DSMRObjectParser):
self.parsers_for_unidentified = parsers_for_unidentified
def _is_line_wellformed(self, line, values):
# allow empty parentheses (indicated by empty string)
if values and (len(values) == 1) and (values[0] == ''):
return True
if values and (len(values) >= 2) and (values[0].isdigit()):
buffer_length = int(values[0])
return (buffer_length <= 10) and (len(values) == (buffer_length * 2 + 2))
@ -234,9 +237,10 @@ class ProfileGenericParser(DSMRObjectParser):
return False
def _parse_values(self, values):
# in case of empty parentheses return
if values and (len(values) == 1) and (values[0] == None):
return [self.value_formats[i].parse(value)
for i, value in enumerate(values)]
return super()._parse_values(values) #calling parent
buffer_length = int(values[0])
buffer_value_obis_ID = values[1]
if (buffer_length > 0):