adafruit / Adafruit_Blinka_bleio

`_bleio` for Blinka based on `bleak`
58 stars 19 forks source link

disconnect connections on ctrl-c #22

Closed dhalbert closed 4 years ago

dhalbert commented 4 years ago

When a script is ctrl-C'd on WIndows or Linux, it can leave open connections, which causes subsequent invocations not to work. This disconnects all connections when at script exits normally or is interrupted by a KeyboardInterrupt (ctrl-C).

Tested on Ubuntu, Windows 10, MacOS (latest), and Raspberry Pi.