From 007b3ea0895ecd91441fb918d48290cee94d1949 Mon Sep 17 00:00:00 2001 From: Gunnar Klauberg Date: Fri, 12 Nov 2021 18:13:48 +0100 Subject: [PATCH] ignoring trailing \xff in byte stream --- dsmr_parser/clients/protocol.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dsmr_parser/clients/protocol.py b/dsmr_parser/clients/protocol.py index 560c0aa..56ed26d 100644 --- a/dsmr_parser/clients/protocol.py +++ b/dsmr_parser/clients/protocol.py @@ -116,7 +116,7 @@ class DSMRProtocol(asyncio.Protocol): def data_received(self, data): """Add incoming data to buffer.""" - data = data.decode("ascii") + data = data.decode("ascii", errors="ignore") self._active = True self.log.debug("received data: %s", data) self.telegram_buffer.append(data) diff --git a/setup.py b/setup.py index 7ad7c68..3852064 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( author_email='nigel@nldr.net', license='MIT', url='https://github.com/ndokter/dsmr_parser', - version='0.30', + version='0.31', packages=find_packages(exclude=('test', 'test.*')), install_requires=[ 'pyserial>=3,<4',