Skip to content

Enhanced bulb scanning#2

Open
arktronic wants to merge 1 commit intobeville:masterfrom
arktronic:scan-fix
Open

Enhanced bulb scanning#2
arktronic wants to merge 1 commit intobeville:masterfrom
arktronic:scan-fix

Conversation

@arktronic
Copy link

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 😄

Code now tries using real interface broadcast addresses instead of relying
on '<broadcast>', which has serious limitations associated with it. A
fallback to previous behavior was implemented as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant