This commit is contained in:
Marco Zeisler 2021-05-17 18:24:13 +02:00
parent d07a616462
commit 96f187910b

View File

@ -48,7 +48,7 @@ class TrafficLight:
# therefore it sleeps on the end of the loop and first status is immediately sent to msg broker
self.current_color = TrafficLight.Color((self._starting_color.value - 1) % num_colors)
while self.running:
self.current_color = self.Color((self.current_color.value + 1) % num_colors)
self.current_color = TrafficLight.Color((self.current_color.value + 1) % num_colors)
self.last_switch = datetime.now()
self.send_status_update()
time.sleep(self.switching_time / SCALING)