Ejemplo n.º 1
0
    def __init__(self, handler, noStrip=NO_STRIP_ATTACHED):
        super(Animator, self).__init__(SOCKET_NAME, handler)
        self.queue = Queue.Queue(1)
        if noStrip:
            strip = Strip.SimulationStrip(STRIP_LENGTH, ROW_LENGTH)
        else:
            strip = Strip.HardwareStrip(STRIP_LENGTH)
        self.strip = strip

        self.counter = ModCounter(len(Animation.DYNAMIC_ANIMATIONS))

        self.stepper = Stepper(self.queue,
                               Animation.ANIMATIONS[Animation.BLACKOUT], strip)
        self.stepper.start()

        if GPIO_AVAILABLE:
            self.buttonmonitor = ButtonMonitor()
            self.buttonmonitor.start()

        self.processCommand(ButtonEvent.SINGLEPRESS)