Beispiel #1
0
class DmxHandler(Handler):
    def __init__(self):
        Handler.__init__(self)

        self.backend = DmxUniverse()

        self.add_listener("send")
        self.add_listener("clear")

        self.start()

    def _wscb_send(self, channel, message):
        self.backend.set_channels(message["channels"])

    def _wscb_clear(self, channel, message):
        # logging.debug("setting background to %s" % message['color'])
        # self.backend.background(message['color'])
        # self.send_status('start', { "type": "background",
        #                             "color": message['color']} )
        # self.ws.send("image.event.background", { "color": message['color']})
        self.backend.clear_channels(message["channels"])

    def start(self):
        logging.info("Starting DMXHandler's websocket")
        self._ws.start(detach=False)
Beispiel #2
0
class DmxHandler(Handler):
    def __init__(self):
        Handler.__init__(self)

        self.backend = DmxUniverse()

        self.add_listener('send')
        self.add_listener('clear')

        self.start()

    def _wscb_send(self, channel, message):
        self.backend.set_channels(message['channels'])

    def _wscb_clear(self, channel, message):
        # logging.debug("setting background to %s" % message['color'])
        # self.backend.background(message['color'])
        # self.send_status('start', { "type": "background",
        #                             "color": message['color']} )
        # self.ws.send("image.event.background", { "color": message['color']})
        self.backend.clear_channels(message['channels'])

    def start(self):
        logging.info("Starting DMXHandler's websocket")
        self._ws.start(detach=False)
Beispiel #3
0
    def __init__(self):
        Handler.__init__(self)

        self.backend = DmxUniverse()

        self.add_listener('send')
        self.add_listener('clear')

        self.start()
Beispiel #4
0
    def __init__(self):
        Handler.__init__(self)

        self.backend = DmxUniverse()

        self.add_listener("send")
        self.add_listener("clear")

        self.start()