Skip to content

Commit

Permalink
check for UnicodeDecodeError
Browse files Browse the repository at this point in the history
  • Loading branch information
TrystanLea committed Jul 17, 2020
1 parent 1da8085 commit 89aabdc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/interfacers/EmonHubJeeInterfacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ def read(self):
"""

# Read serial RX
self._rx_buf = self._rx_buf + self._ser.readline().decode()

try:
self._rx_buf = self._rx_buf + self._ser.readline().decode()
except UnicodeDecodeError:
return

# If line incomplete, exit
if '\r\n' not in self._rx_buf:
return
Expand Down

0 comments on commit 89aabdc

Please sign in to comment.