kjdsa
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from lamps.Lamp import Lamp
|
||||
from itertools import cycle
|
||||
import random
|
||||
import time
|
||||
|
||||
class LampGroup:
|
||||
@@ -39,6 +40,11 @@ class LampGroup:
|
||||
|
||||
self.currentLampPtr -= 1
|
||||
|
||||
def toggleRandom(self, sleepTime):
|
||||
random_lamp = random.choice(self.lamps)
|
||||
random_lamp.activate()
|
||||
time.sleep(sleepTime)
|
||||
random_lamp.deactivate()
|
||||
def cycle(self):
|
||||
if self.currentLamp:
|
||||
self.currentLamp.deactivate()
|
||||
|
||||
Reference in New Issue
Block a user