ignoring trailing \xff in byte stream

This commit is contained in:
Gunnar Klauberg 2021-11-12 18:13:48 +01:00
parent 761aaccb3f
commit 007b3ea089
2 changed files with 2 additions and 2 deletions

View File

@ -116,7 +116,7 @@ class DSMRProtocol(asyncio.Protocol):
def data_received(self, data): def data_received(self, data):
"""Add incoming data to buffer.""" """Add incoming data to buffer."""
data = data.decode("ascii") data = data.decode("ascii", errors="ignore")
self._active = True self._active = True
self.log.debug("received data: %s", data) self.log.debug("received data: %s", data)
self.telegram_buffer.append(data) self.telegram_buffer.append(data)

View File

@ -7,7 +7,7 @@ setup(
author_email='nigel@nldr.net', author_email='nigel@nldr.net',
license='MIT', license='MIT',
url='https://github.com/ndokter/dsmr_parser', url='https://github.com/ndokter/dsmr_parser',
version='0.30', version='0.31',
packages=find_packages(exclude=('test', 'test.*')), packages=find_packages(exclude=('test', 'test.*')),
install_requires=[ install_requires=[
'pyserial>=3,<4', 'pyserial>=3,<4',