From e3203a5334a3dc95160f45f3ca3aaddc971d0b1f Mon Sep 17 00:00:00 2001 From: Vincent van den Braken Date: Fri, 15 Sep 2017 13:48:10 +0200 Subject: [PATCH] Optional NUL after checksum My smart meter returns 00 0D 0A after the checksum, not just 0D 0A. --- dsmr_parser/clients/telegram_buffer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsmr_parser/clients/telegram_buffer.py b/dsmr_parser/clients/telegram_buffer.py index 78a98eb..5933296 100644 --- a/dsmr_parser/clients/telegram_buffer.py +++ b/dsmr_parser/clients/telegram_buffer.py @@ -51,7 +51,7 @@ class TelegramBuffer(object): # - The checksum is optional '{0,4}' because not all telegram versions # support it. return re.findall( - r'\/[^\/]+?\![A-F0-9]{0,4}\r\n', + r'\/[^\/]+?\![A-F0-9]{0,4}\0?\r\n', self._buffer, re.DOTALL )