sbidy / pywizlight

A python connector for WiZ devices
MIT License
463 stars 79 forks source link

discovery failed on multihomed windows machine #28

Closed The-Fons closed 3 years ago

The-Fons commented 4 years ago

Discovery failed on a multihomed windows 10 box, is seemed to broadcast on the wrong networkinterface. After changing the broadcast address 255.255.255.255 in broadcast_registration to the local network broadcast address 192.168.0.255 it worked.

sbidy commented 4 years ago

Hey, yes that correct. On a multi homed system this will be a problem. I'll check to implement a custom parameter for defining the broadcast.

fabaff commented 4 years ago

@The-Fons, could you please take a look at #30? Sample snippet below:

import asyncio
import logging 
from pywizlight.discovery import find_wizlights

async def main():
    bulbs = await find_wizlights(broadcast_address="192.168.0.255")
    for bulb in bulbs:
        print(bulb.__dict__)

if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
The-Fons commented 4 years ago

This work on my box. thanks. :-)

The-Fons commented 3 years ago

Thanks for addressing the issue.