black
and isort
everything
This commit is contained in:
parent
bb2ce5c8f4
commit
4481177ec6
7 changed files with 32 additions and 24 deletions
|
@ -8,6 +8,7 @@ from sacn import sACNsender
|
||||||
|
|
||||||
LOG = logging.getLogger('DMXQueue')
|
LOG = logging.getLogger('DMXQueue')
|
||||||
|
|
||||||
|
|
||||||
class DMXQueue:
|
class DMXQueue:
|
||||||
def __init__(self, args, queue, lights):
|
def __init__(self, args, queue, lights):
|
||||||
self.args = args
|
self.args = args
|
||||||
|
|
|
@ -2,6 +2,7 @@ import logging
|
||||||
|
|
||||||
LOG = logging.getLogger('DMX')
|
LOG = logging.getLogger('DMX')
|
||||||
|
|
||||||
|
|
||||||
class BaseDMXLight:
|
class BaseDMXLight:
|
||||||
def __init__(self, address):
|
def __init__(self, address):
|
||||||
self.address = address
|
self.address = address
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from .common import BaseDMXLight
|
from .common import BaseDMXLight
|
||||||
|
|
||||||
|
|
||||||
class IgnitionWALL710(BaseDMXLight):
|
class IgnitionWALL710(BaseDMXLight):
|
||||||
name = "Ignition WAL-L710 PAR"
|
name = "Ignition WAL-L710 PAR"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from .common import BaseDMXLight
|
from .common import BaseDMXLight
|
||||||
|
|
||||||
|
|
||||||
class VarytecHeroWashZoom712(BaseDMXLight):
|
class VarytecHeroWashZoom712(BaseDMXLight):
|
||||||
name = "Varytec Hero Wash 712 Z RGBW Zoom"
|
name = "Varytec Hero Wash 712 Z RGBW Zoom"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from .common import BaseDMXLight
|
from .common import BaseDMXLight
|
||||||
|
|
||||||
|
|
||||||
class WLED(BaseDMXLight):
|
class WLED(BaseDMXLight):
|
||||||
name = "WLED"
|
name = "WLED"
|
||||||
|
|
||||||
|
|
8
main.py
8
main.py
|
@ -7,11 +7,10 @@ from sys import exit
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
from dmx_queue import DMXQueue
|
from dmx_queue import DMXQueue
|
||||||
from mqtt_queue import MQTTQueue
|
|
||||||
|
|
||||||
from lights.wled import WLED
|
|
||||||
from lights.ignition_wal_l710 import IgnitionWALL710
|
from lights.ignition_wal_l710 import IgnitionWALL710
|
||||||
from lights.varytec_hero_wash_zoom_712 import VarytecHeroWashZoom712
|
from lights.varytec_hero_wash_zoom_712 import VarytecHeroWashZoom712
|
||||||
|
from lights.wled import WLED
|
||||||
|
from mqtt_queue import MQTTQueue
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.DEBUG,
|
level=logging.DEBUG,
|
||||||
|
@ -20,8 +19,8 @@ logging.basicConfig(
|
||||||
|
|
||||||
LOG = logging.getLogger('main')
|
LOG = logging.getLogger('main')
|
||||||
|
|
||||||
def main():
|
|
||||||
|
|
||||||
|
def main():
|
||||||
parser = ArgumentParser()
|
parser = ArgumentParser()
|
||||||
|
|
||||||
# rainbow is output if we have no effects
|
# rainbow is output if we have no effects
|
||||||
|
@ -124,5 +123,6 @@ def main():
|
||||||
|
|
||||||
LOG.info('Bye!')
|
LOG.info('Bye!')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -8,6 +8,7 @@ from sacn import sACNsender
|
||||||
|
|
||||||
LOG = logging.getLogger('MQTTQueue')
|
LOG = logging.getLogger('MQTTQueue')
|
||||||
|
|
||||||
|
|
||||||
class MQTTQueue:
|
class MQTTQueue:
|
||||||
def __init__(self, args, queue):
|
def __init__(self, args, queue):
|
||||||
self.args = args
|
self.args = args
|
||||||
|
@ -44,10 +45,12 @@ class MQTTQueue:
|
||||||
|
|
||||||
text = re.sub(r'\<[a-z\/]+\>', '', data['msg'])
|
text = re.sub(r'\<[a-z\/]+\>', '', data['msg'])
|
||||||
|
|
||||||
self.queue.put((
|
self.queue.put(
|
||||||
|
(
|
||||||
data['level'].lower(),
|
data['level'].lower(),
|
||||||
data['component'],
|
data['component'],
|
||||||
text,
|
text,
|
||||||
))
|
)
|
||||||
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.exception(msg.payload)
|
LOG.exception(msg.payload)
|
||||||
|
|
Loading…
Reference in a new issue