ChristianKuehnel / btlewrap

Bluetooth LowEnergy wrapper for different python backends.
MIT License
35 stars 19 forks source link

Adaption of wait_for_notification() for Blusensor AIQ #42

Open Gezzo42 opened 3 years ago

Gezzo42 commented 3 years ago

Recently I bought the mentioned sensor and wanted to integrate it using BLE (also it support MQTT via WLAN). I found btlewrap a nice lib to use for, because MI temp as a similar sensor used it too. But in the case of Blusensor AIQ wait_for_notificaton() was not working. The write command ended up in an exception. Therefore I added an additional variant named wait_for_notification_no_write() and simply deleted this function call. Then everything works fin. The sensor spams notification after connection. Perhaps on option for wait_for_notification() is another solution?!

In my fork I added the function: https://github.com/Gezzo42/btlewrap/blob/a1c6953e5ed1dd64f027c2d1a757eb72a21fe15b/btlewrap/bluepy.py

It would be nice, if you can add it to btlewrap :-).