Drolla / WavePlus_Bridge

Airthings Wave Plus Bridge to Wifi/LAN and MQTT
MIT License
21 stars 9 forks source link

Add optional retry + retry delay for intermittent connections (possibly help with #9) #10

Closed zeyus closed 2 years ago

zeyus commented 2 years ago

My devices are quite far from the raspberry pi, and there's not a lot I can do about it, sometimes the connection works and sometimes it doesn't.

This just adds a retry which seems to work for me, and hopefully others as well as may be the case in #9 , if there's an underlying issue besides the distance from the pi to the device, then this probably won't help.

image

Drolla commented 2 years ago

Hi @zeyus , this looks good. Thanks for your contribution. I will merge it into the main branch.

Drolla commented 2 years ago

FYI - I did some code refactoring and moved the Wave Plus device communication class into a separate module (libs/waveplus.py). The submitted retry mechanism has been moved to the new method 'get' of this class. Nothing has changed from a user perspective.

zeyus commented 2 years ago

@Drolla awesome thanks, I'll update my sources with the changes too. You've made a really useful app, I appreciate it!