From 681de3eeda34ecfab4cb54c26cc67f35cd25a187 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 13 Sep 2016 17:18:15 +0200 Subject: [PATCH] Ensure color_pos is always -1 when the lights go out, so behaviour is always consistent --- tabakrolletjie/lights.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tabakrolletjie/lights.py b/tabakrolletjie/lights.py index cda6002..22da021 100644 --- a/tabakrolletjie/lights.py +++ b/tabakrolletjie/lights.py @@ -159,7 +159,7 @@ class BaseLight(object): self.colour_pos = colours.index(start_colour) self.colour = start_colour self.on = on - if not on and len(colours) > 1: + if not on: self.colour_pos = -1 self.intensity = intensity self.body = pymunk.Body(0, 0, pymunk.body.Body.STATIC) @@ -294,6 +294,7 @@ class BaseLight(object): def off(self): self.on = False + self.colour_pos = -1 def toggle(self): self.colour_pos += 1 -- 2.34.1