mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-01-23 05:07:09 +00:00
71ac1f043a
* add (untested) discover mode * Keep discovery and normal communication separate, uppercase magic consts This sepearates the earlier test code for discovering devices, and adds 5 sec timeout for gathering responses from potential devices. This commit also uppercases magic constants. Discovery & communication tested with HS110. * update readme with example how to discover devices, pep8ify
10 lines
220 B
Python
10 lines
220 B
Python
import logging
|
|
from pprint import pprint as pp
|
|
|
|
from pyHS100 import TPLinkSmartHomeProtocol
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
|
|
for dev in TPLinkSmartHomeProtocol.discover():
|
|
print("Found device!")
|
|
pp(dev)
|