From ab9e829d971be3c52d9bab1d550ee9bccd1d72f3 Mon Sep 17 00:00:00 2001 From: Andrey Pohilko Date: Thu, 21 Dec 2017 17:02:47 +0300 Subject: [PATCH] Couple more constants faced --- pylgbst/constants.py | 3 ++- pylgbst/movehub.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pylgbst/constants.py b/pylgbst/constants.py index 4c8052f..86ff01f 100644 --- a/pylgbst/constants.py +++ b/pylgbst/constants.py @@ -88,7 +88,8 @@ DEVICE_TYPES = { STATUS_STARTED = 0x01 STATUS_CONFLICT = 0x05 STATUS_FINISHED = 0x0a -STATUS_SOMEPROBLEM = 0x0c +STATUS_INPROGRESS = 0x0c # FIXME: not sure about description +STATUS_INTERRUPTED = 0x0e # FIXME: not sure about description # COLORS COLOR_BLACK = 0x00 diff --git a/pylgbst/movehub.py b/pylgbst/movehub.py index 65eb5d5..c9091c1 100644 --- a/pylgbst/movehub.py +++ b/pylgbst/movehub.py @@ -144,8 +144,11 @@ class MoveHub(object): elif status == STATUS_CONFLICT: log.warning("Command conflict on port %s", PORTS[port]) self.devices[port].finished() - elif status == STATUS_SOMEPROBLEM: - log.warning("Command problem on port %s", PORTS[port]) + elif status == STATUS_INPROGRESS: + log.warning("Another command is in progress on port %s", PORTS[port]) + self.devices[port].finished() + elif status == STATUS_INTERRUPTED: + log.warning("Command interrupted on port %s", PORTS[port]) self.devices[port].finished() else: log.warning("Unhandled status value: 0x%x on port %s", status, PORTS[port])