-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhomestage-server.py
40 lines (30 loc) · 1.23 KB
/
homestage-server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import argparse
import logging
from engineio.payload import Payload
from homestage.api import WebServer
from homestage.controller import HomeStage, StageConfig
from homestage.outputs import PatchedsACNSender
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', default='config.json')
args = parser.parse_args()
logging.basicConfig(level=logging.INFO,
format="%(asctime)s (%(levelname)s) [%(name)s] %(message)s",
datefmt="%H:%M:%S")
logging.getLogger('werkzeug').setLevel(logging.ERROR)
logging.getLogger('socketio.server').setLevel(logging.ERROR)
logging.getLogger('engineio.server').setLevel(logging.ERROR)
config = StageConfig(args.config)
config.load()
config.save()
Payload.max_decode_packets = 500
output = PatchedsACNSender(fps=60, bind_address=config.sacn_bind_address)
output.activate_output(config.sacn_universe)
output[config.sacn_universe].multicast = config.sacn_multicast
output[config.sacn_universe].destination = config.sacn_destination
stage = HomeStage(config, config.fixtures, output)
server = WebServer(stage)
stage.start()
server.start()
if __name__ == '__main__':
main()