flux_led
flux_led copied to clipboard
Enhanced bulb scanning
The current code uses <broadcast>
, a.k.a. INADDR_BROADCAST
, to scan for bulbs. I found that this doesn't work in all situations (including mine) due to the limitations of such broadcasts.
In this PR I changed the code to use the netifaces
package to find all interfaces, get their IPv4 broadcast address(es), and use them to broadcast the device discovery message. If netifaces
is unavailable or if for some reason it can't find any broadcast addresses, the code falls back to using <broadcast>
.
I preemptively apologize for any non-Pythonic code here; Python isn't something I use every day :smile: