From 365302e2cd28aa35758c3c45f96bdd16c2db13a9 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 4 Aug 2020 13:52:38 +0200 Subject: [PATCH] fix serial cmd --- raspberry/roberto/Serial.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/raspberry/roberto/Serial.py b/raspberry/roberto/Serial.py index c5c3d08..8de2b65 100644 --- a/raspberry/roberto/Serial.py +++ b/raspberry/roberto/Serial.py @@ -49,12 +49,12 @@ class Serial(object): if data: print(data) command = data[0] - argument = data[2:] - if command in data: + argument = data[2:].strip() + if isalnum(command) and command in self._callbacks: cb = self._callbacks[command] if cb: cb(argument) - + except serial.SerialException: pass #self.alive = False