From 8121bb73f9a33ce25c88e8c7e1bd5b8ad855afbc Mon Sep 17 00:00:00 2001 From: mak-gitdev Date: Sat, 3 Jun 2023 01:27:53 +0200 Subject: [PATCH] Fix "list index out of range" as per kipe/enocean#138 Apply patch from @kridgo. See kipe/enocean#134 and kipe/enocean#138 for more details. --- enocean/communicators/serialcommunicator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/enocean/communicators/serialcommunicator.py b/enocean/communicators/serialcommunicator.py index ffe4201..6bc638d 100644 --- a/enocean/communicators/serialcommunicator.py +++ b/enocean/communicators/serialcommunicator.py @@ -36,7 +36,10 @@ def run(self): except serial.SerialException: self.logger.error('Serial port exception! (device disconnected or multiple access on port?)') self.stop() - self.parse() + try: + self.parse() + except Exception as e: + self.logger.error('Exception occured while parsing: ' + str(e)) time.sleep(0) self.__ser.close()