Optional NUL after checksum

My smart meter returns 00 0D 0A after the checksum, not just 0D 0A.
This commit is contained in:
Vincent van den Braken 2017-09-15 13:48:10 +02:00 committed by GitHub
parent c78ebe3e2d
commit e3203a5334

View File

@ -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
)