From 160b209116143621e91351d92136adc37031f804 Mon Sep 17 00:00:00 2001
From: "Emilio J. Palacios-Garcia" <emiliojose.palaciosgarcia@kuleuven.be>
Date: Thu, 19 Oct 2023 11:34:32 +0200
Subject: [PATCH] if occurred time is not initialised default to timestamp of
 the month

---
 dsmr_parser/parsers.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dsmr_parser/parsers.py b/dsmr_parser/parsers.py
index 61515fc..a140609 100644
--- a/dsmr_parser/parsers.py
+++ b/dsmr_parser/parsers.py
@@ -276,6 +276,8 @@ class MaxDemandParser(DSMRObjectParser):
         for i in range(1, count + 1):
             timestamp_month = ValueParser(timestamp).parse(values[i * 3 + 0])
             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])
             objects.append(MBusObjectPeak(
                 obis_id_code=obis_id_code,