From a5a9a3366c29991ff8ef23885109827887bb8178 Mon Sep 17 00:00:00 2001 From: Andrey Pohilko Date: Wed, 20 Dec 2017 11:55:58 +0300 Subject: [PATCH] One more port status --- pylgbst/constants.py | 1 + pylgbst/movehub.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pylgbst/constants.py b/pylgbst/constants.py index cdfc538..4c8052f 100644 --- a/pylgbst/constants.py +++ b/pylgbst/constants.py @@ -88,6 +88,7 @@ DEVICE_TYPES = { STATUS_STARTED = 0x01 STATUS_CONFLICT = 0x05 STATUS_FINISHED = 0x0a +STATUS_SOMEPROBLEM = 0x0c # COLORS COLOR_BLACK = 0x00 diff --git a/pylgbst/movehub.py b/pylgbst/movehub.py index fd3142b..65eb5d5 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]) + self.devices[port].finished() else: - log.warning("Unhandled status value: 0x%x", status) + log.warning("Unhandled status value: 0x%x on port %s", status, PORTS[port]) def _handle_port_info(self, data): port = usbyte(data, 3)