if occurred time is not initialised default to timestamp of the month

This commit is contained in:
Emilio J. Palacios-Garcia 2023-10-19 11:34:32 +02:00
parent 88923622a9
commit 160b209116
No known key found for this signature in database
GPG Key ID: A70D7AD28FC90237

View File

@ -276,6 +276,8 @@ class MaxDemandParser(DSMRObjectParser):
for i in range(1, count + 1): for i in range(1, count + 1):
timestamp_month = ValueParser(timestamp).parse(values[i * 3 + 0]) timestamp_month = ValueParser(timestamp).parse(values[i * 3 + 0])
timestamp_occurred = ValueParser(timestamp).parse(values[i * 3 + 1]) timestamp_occurred = ValueParser(timestamp).parse(values[i * 3 + 1])
if timestamp_occurred["value"] is None:
timestamp_occurred["value"] = timestamp_month["value"]
value = ValueParser(Decimal).parse(values[i * 3 + 2]) value = ValueParser(Decimal).parse(values[i * 3 + 2])
objects.append(MBusObjectPeak( objects.append(MBusObjectPeak(
obis_id_code=obis_id_code, obis_id_code=obis_id_code,