We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e06278 commit 4b6e5dfCopy full SHA for 4b6e5df
disco.py
@@ -2,7 +2,6 @@
2
import kasa
3
import random
4
5
-runtimeSeconds = 60 # how long should the disco last? (hint: forever is best)
6
searchTimeout = 10 # default is 5, but this seems more reliable
7
8
async def randomset(bulbs, t):
@@ -21,6 +20,7 @@ async def initBulb(ip):
21
20
22
async def main():
23
print('Disco time. Searching for Kasa RGB bulbs...')
+ print('Ctrl + C to exit at any time')
24
25
found_devices = await kasa.Discover.discover(timeout=searchTimeout)
26
bulb_devices = []
@@ -32,10 +32,9 @@ async def main():
32
if not bulb_devices:
33
print('No Kasa RGB bulb devices found')
34
else:
35
- for x in range(1, runtimeSeconds):
+ while True:
36
await randomset(bulb_devices, 1_000)
37
await asyncio.sleep(1)
38
- print('Done')
39
40
loop = asyncio.get_event_loop()
41
try:
0 commit comments