keptenkurk / BS440

Python code to talk to Medisana BS440 bluetooth enabled bathroom scale
MIT License
50 stars 34 forks source link

Exception issue on disconnect #55

Closed SamuelBrucksch closed 7 years ago

SamuelBrucksch commented 7 years ago

fixed exception:

Traceback (most recent call last):
  File "BS440.py", line 172, in <module>
    device.disconnect()
  File "/usr/local/lib/python2.7/dist-packages/pygatt/backends/gatttool/device.py", line 17, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pygatt/backends/gatttool/device.py", line 52, in disconnect
    self._backend.disconnect(self)
  File "/usr/local/lib/python2.7/dist-packages/pygatt/backends/gatttool/gatttool.py", line 52, in wrapper
    raise NotConnectedError()
pygatt.exceptions.NotConnectedError

by catching NotConnectedError on disconnect

keptenkurk commented 7 years ago

Thanks @SamuelBrucksch ! Never ran into this but this definately will occur when the scale gets disconnected while waiting for the notifications...

SamuelBrucksch commented 7 years ago

Thanks for merging. BTW good work so far. Works out of the box with Medisana BS 444.