thomasdelaet / python-velbus

A python library to control the Velbus home automation system
MIT License
17 stars 8 forks source link

Dynamic load timeout #78

Closed brefra closed 3 years ago

brefra commented 3 years ago

Based on log supplied at #76

PR still draft, as I'm currently still testing the code changes

thomasdelaet commented 3 years ago

Thank you! I will try to take a look this weekend and get it in.

thomasdelaet commented 3 years ago

Hey @brefra

Thanks for doing this! I was wondering if you have looked at using the existing async_scan method. This has no timeout associated and will get you module as they are discovered. I've adapted the scan.py script in examples dir to demonstrate use.

brefra commented 3 years ago

I've seen the async_scan method. As the async_scan method only request to load the module once it will try to retrieve the module names only once too. Unfortunately the log shows the discovery fails because the 3rd part of a channel name is not getting in. So the module won't finish the loading. The workaround in this PR is to submit new name request at the first timeout to the module to try retrieve the channel names again.