1
0
mirror of https://github.com/undera/pylgbst.git synced 2020-11-18 19:37:26 -08:00

Cosmetics

This commit is contained in:
Andrey Pohilko 2017-09-25 16:13:22 +03:00
parent a7094d5392
commit 5f60ed3500
3 changed files with 5 additions and 4 deletions

View File

@ -287,8 +287,6 @@ Then push green button on MoveHub, so permanent BLE connection will be establish
## Roadmap & TODO
- work out completely synchronous command model - with either command error or confirmation
- organize requesting and printing device info on startup - firmware version at least
- document all API methods
- make sure unit tests cover all important code
- make debug server to re-establish BLE connection on loss

View File

@ -189,5 +189,5 @@ if __name__ == '__main__':
connection = BLEConnection().connect()
hub = MoveHub(connection)
demo_all(hub)
sleep(10000)
#demo_all(hub)

View File

@ -104,6 +104,8 @@ class MoveHub(object):
self.devices[port].finished()
elif msg_type == MSG_PORT_CMD_ERROR:
log.warning("Command error: %s", str2hex(data[3:]))
port = usbyte(data, 3)
self.devices[port].finished()
elif msg_type == MSG_DEVICE_SHUTDOWN:
log.warning("Device reported shutdown: %s", str2hex(data))
raise KeyboardInterrupt("Device shutdown")
@ -141,6 +143,7 @@ class MoveHub(object):
self.devices[port].finished()
elif status == STATUS_CONFLICT:
log.warning("Command conflict on port %s", PORTS[port])
self.devices[port].finished()
else:
log.warning("Unhandled status value: 0x%x", status)