From 2a6eb11db5a14c444e89329fdafc4759c33ca99f Mon Sep 17 00:00:00 2001 From: waltem01 Date: Wed, 13 Mar 2024 13:27:54 +0100 Subject: [PATCH] overwrite cli args with dotenv --- API/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/API/main.py b/API/main.py index 279e772..25b20fe 100755 --- a/API/main.py +++ b/API/main.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import os from deps.samplebase import SampleBase from rgbmatrix import graphics from PIL import Image @@ -268,6 +269,10 @@ def update_matrix(): class Matrix(SampleBase): def __init__(self, *args, **kwargs): super(Matrix, self).__init__(*args, **kwargs) + self.parser.add_argument("-r", "--led-rows", action="store", help="Display rows. 16 for 16x32, 32 for 32x32. Default: 64", default=int(os.getenv('PUBLIC_LED_WIDTH', 64)), type=int) + self.parser.add_argument("--led-cols", action="store", help="Panel columns. Typically 32 or 64. (Default: 64)", default=int(os.getenv('PUBLIC_LED_PARALLEL', 64)), type=int) + self.parser.add_argument("-c", "--led-chain", action="store", help="Daisy-chained boards. Default: 1.", default=int(os.getenv('PUBLIC_LED_CHAIN', 1)), type=int) + self.parser.add_argument("-P", "--led-parallel", action="store", help="For Plus-models or RPi2: parallel chains. 1..3. Default: 1", default=int(os.getenv('PUBLIC_LED_PARALLEL', 1)), type=int) # run display program def run(self):