master
1import pywemo
2
3# Total number of wemo devices inside the broadcast domain
4NUM_WEMO_DEVICES = 12
5
6def find_and_show_all_wemo_devices():
7 devices = {}
8 while len(devices) < NUM_WEMO_DEVICES:
9 print("discovering devices ... ", end="")
10 devices = pywemo.discover_devices()
11 print("{}/{}".format(len(devices), NUM_WEMO_DEVICES))
12
13 print("--- {} Devices Found ---".format(len(devices)))
14 for d in devices:
15 print(" {:24}{:16}{:12}".format(d.name, d.host, d.mac))
16
17
18if __name__ == "__main__":
19 find_and_show_all_wemo_devices()