sbidy / pywizlight

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

Refactoring of the discovery feature #30

Closed fabaff closed 3 years ago

fabaff commented 4 years ago
import asyncio
import logging 
from pywizlight.discovery import find_wizlights

async def main():
    bulbs = await find_wizlights()
    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())

Broadcast address can be set:

bulbs = await find_wizlights(broadcast_address="255.255.255.255")

This should be tested, please.