bugfix: setting defaults instead of overwriting

This commit is contained in:
waltem01 2024-03-13 13:46:32 +01:00
parent 2a6eb11db5
commit c1e0ba56c3

View File

@ -269,10 +269,10 @@ def update_matrix():
class Matrix(SampleBase): class Matrix(SampleBase):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(Matrix, self).__init__(*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.set_defaults(led_rows=int(os.getenv('PUBLIC_LED_WIDTH', 64)))
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.set_defaults(led_cols=int(os.getenv('PUBLIC_LED_HEIGHT', 64)))
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.set_defaults(led_chain=int(os.getenv('PUBLIC_LED_CHAIN', 1)))
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) self.parser.set_defaults(led_parallel=int(os.getenv('PUBLIC_LED_PARALLEL', 1)))
# run display program # run display program
def run(self): def run(self):