Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Put_characteristic takes to long #21
I agree that the Zeroconfig, although nice for people that might have constantly changing IPs, is time consuming. I've slightly modified the program to read IP address and Port from the pairing data file however the way I did it is a very hacky and ugly way that I would not suggest anyone else do...
But I would suggest that when pairing the IP and Port get stored in the pairing data file and then either make a command line switch to use that instead of Zeroconfig or only fall back to Zeroconfig if the device cannot be reached on the stored address.
The lag time before a command is executed is cut by almost half for me using an IP address directly.
@raufis27 Like I said it's bad, more of a proof of concept than anything. The command-line switch opinion I described and letting python manage the pairing data file is much more sustainable long term I think, but here it is:
First in the pairing data file add these lines:
Obviously replacing the IP and Port info with what's correct for your device. Make sure you fix the commas, so my complete pairing data file looks like this now (the order doesn't matter, just make sure the commas are right):
Then in put_characteristic.py comment out these lines:
and in their place add:
So that section of put_characteristic.py should look like:
Of course this change only affects the put_characteristic command
I did some quick profiling and it looks like that there 2 slow parts: