From: Neil Date: Tue, 13 Sep 2016 15:18:15 +0000 (+0200) Subject: Ensure color_pos is always -1 when the lights go out, so behaviour is always consistent X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=681de3eeda34ecfab4cb54c26cc67f35cd25a187;p=tabakrolletjie.git Ensure color_pos is always -1 when the lights go out, so behaviour is always consistent --- 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