mirror of
https://github.com/undera/pylgbst.git
synced 2020-11-18 19:37:26 -08:00
Cosmetics
This commit is contained in:
parent
a7094d5392
commit
5f60ed3500
@ -287,8 +287,6 @@ Then push green button on MoveHub, so permanent BLE connection will be establish
|
|||||||
|
|
||||||
## Roadmap & TODO
|
## 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
|
- document all API methods
|
||||||
- make sure unit tests cover all important code
|
- make sure unit tests cover all important code
|
||||||
- make debug server to re-establish BLE connection on loss
|
- make debug server to re-establish BLE connection on loss
|
||||||
|
4
demo.py
4
demo.py
@ -189,5 +189,5 @@ if __name__ == '__main__':
|
|||||||
connection = BLEConnection().connect()
|
connection = BLEConnection().connect()
|
||||||
|
|
||||||
hub = MoveHub(connection)
|
hub = MoveHub(connection)
|
||||||
|
sleep(10000)
|
||||||
demo_all(hub)
|
#demo_all(hub)
|
||||||
|
@ -104,6 +104,8 @@ class MoveHub(object):
|
|||||||
self.devices[port].finished()
|
self.devices[port].finished()
|
||||||
elif msg_type == MSG_PORT_CMD_ERROR:
|
elif msg_type == MSG_PORT_CMD_ERROR:
|
||||||
log.warning("Command error: %s", str2hex(data[3:]))
|
log.warning("Command error: %s", str2hex(data[3:]))
|
||||||
|
port = usbyte(data, 3)
|
||||||
|
self.devices[port].finished()
|
||||||
elif msg_type == MSG_DEVICE_SHUTDOWN:
|
elif msg_type == MSG_DEVICE_SHUTDOWN:
|
||||||
log.warning("Device reported shutdown: %s", str2hex(data))
|
log.warning("Device reported shutdown: %s", str2hex(data))
|
||||||
raise KeyboardInterrupt("Device shutdown")
|
raise KeyboardInterrupt("Device shutdown")
|
||||||
@ -141,6 +143,7 @@ class MoveHub(object):
|
|||||||
self.devices[port].finished()
|
self.devices[port].finished()
|
||||||
elif status == STATUS_CONFLICT:
|
elif status == STATUS_CONFLICT:
|
||||||
log.warning("Command conflict on port %s", PORTS[port])
|
log.warning("Command conflict on port %s", PORTS[port])
|
||||||
|
self.devices[port].finished()
|
||||||
else:
|
else:
|
||||||
log.warning("Unhandled status value: 0x%x", status)
|
log.warning("Unhandled status value: 0x%x", status)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user