This commit is contained in:
Jonas Zeunert
2022-08-31 17:39:19 +02:00
parent 7dea027c6c
commit 0e786ac17f
2 changed files with 17 additions and 6 deletions

View File

@@ -43,9 +43,12 @@ class LampGroup:
def toggleRandom(self, sleepTime):
count = random.randint(1,3)
random_lamps = random.choices(self.lamps, k=count)
for lamp in random_lamps:
lamp.activate()
time.sleep(sleepTime)
for lamp in random_lamps:
lamp.deactivate()