Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7b4929eab | ||
|
|
8999b1c924 | ||
|
|
2391f38c4a | ||
|
|
d1a6e15c68 | ||
|
|
b7c8626d0c | ||
|
|
dc902a83e9 | ||
|
|
be4386bc59 |
@@ -1,6 +1,9 @@
|
||||
Change Log
|
||||
----------
|
||||
|
||||
**0.25** (2020-12-14)
|
||||
- fix for empty parentheses in ProfileGenericParser (`pull request #57 <https://github.com/ndokter/dsmr_parser/pull/57>`_).
|
||||
|
||||
**0.24** (2020-11-27)
|
||||
- Add Luxembourg equipment identifier (`pull request #62 <https://github.com/ndokter/dsmr_parser/pull/62>`_).
|
||||
|
||||
|
||||
@@ -48,7 +48,11 @@ EN = {
|
||||
obis.GAS_METER_READING: 'GAS_METER_READING',
|
||||
obis.ACTUAL_TRESHOLD_ELECTRICITY: 'ACTUAL_TRESHOLD_ELECTRICITY',
|
||||
obis.ACTUAL_SWITCH_POSITION: 'ACTUAL_SWITCH_POSITION',
|
||||
obis.VALVE_POSITION_GAS: 'VALVE_POSITION_GAS'
|
||||
obis.VALVE_POSITION_GAS: 'VALVE_POSITION_GAS',
|
||||
obis.BELGIUM_HOURLY_GAS_METER_READING: 'BELGIUM_HOURLY_GAS_METER_READING',
|
||||
obis.LUXEMBOURG_EQUIPMENT_IDENTIFIER: 'LUXEMBOURG_EQUIPMENT_IDENTIFIER',
|
||||
obis.LUXEMBOURG_ELECTRICITY_USED_TARIFF_GLOBAL: 'LUXEMBOURG_ELECTRICITY_USED_TARIFF_GLOBAL',
|
||||
obis.LUXEMBOURG_ELECTRICITY_DELIVERED_TARIFF_GLOBAL: 'LUXEMBOURG_ELECTRICITY_DELIVERED_TARIFF_GLOBAL'
|
||||
}
|
||||
|
||||
REVERSE_EN = dict([(v, k) for k, v in EN.items()])
|
||||
|
||||
@@ -225,6 +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))
|
||||
@@ -232,6 +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 super()._parse_values(values) #calling parent
|
||||
|
||||
buffer_length = int(values[0])
|
||||
buffer_value_obis_ID = values[1]
|
||||
if (buffer_length > 0):
|
||||
|
||||
Reference in New Issue
Block a user