Make port configurable

This commit is contained in:
Stefan Bethke 2024-02-26 22:58:14 +01:00
parent 8c2c7fb8bc
commit e9f4786788
2 changed files with 3 additions and 2 deletions

View file

@ -2,4 +2,4 @@
here=$(cd $(dirname $0); pwd) here=$(cd $(dirname $0); pwd)
cd $here cd $here
exec poetry run python foobaz.py -a 127.0.0.1 -r shop -u 2 exec poetry run python foobaz.py -a 127.0.0.1 -p 8081 -r shop -u 2

View file

@ -47,6 +47,7 @@ def main(args):
parser = argparse.ArgumentParser(prog='foobazdmx', description='Make the lights flicker.') parser = argparse.ArgumentParser(prog='foobazdmx', description='Make the lights flicker.')
parser.add_argument('-a', '--artnet', type=str, required=True, default="127.0.0.1", help="Art-Net server") parser.add_argument('-a', '--artnet', type=str, required=True, default="127.0.0.1", help="Art-Net server")
parser.add_argument('-l', '--listen', type=int, required=False, default=8080, help="TCP port to listen on for web")
parser.add_argument('-r', '--room', type=str, required=True, help="light setup for room: shop or big") parser.add_argument('-r', '--room', type=str, required=True, help="light setup for room: shop or big")
parser.add_argument('-u', '--universe', type=int, required=False, default=1, help="Universe to send to") parser.add_argument('-u', '--universe', type=int, required=False, default=1, help="Universe to send to")
args = parser.parse_args(args) args = parser.parse_args(args)
@ -79,7 +80,7 @@ def main(args):
dmx.color = (0, 0, 0) dmx.color = (0, 0, 0)
dmx.animation = "off" dmx.animation = "off"
run(host='0.0.0.0', port=8080, reloader=False, debug=True) run(host='0.0.0.0', port=args.port, reloader=False, debug=True)
if __name__ == '__main__': if __name__ == '__main__':
main(sys.argv[1:]) main(sys.argv[1:])