baryluk / fnirsi-usb-power-data-logger

Driver / Data logger for FNIRSI FNB48, FNIRSI C1 and FNIRSI FNB58 USB Power meter
MIT License
141 stars 14 forks source link

Fix bug preventing alpha being set to 0. #23

Closed pdl-user closed 2 months ago

pdl-user commented 3 months ago

The previous code to to set an opional value for the temperature smoothing factor alpha redundantly set alpha to the default value if no --alpha was specified. The implementation was such that --alpha=0 actually set alpha to 0.9

This commit fixes that and is also tighter code, by simply setting

alpha = args.alpha

and of course the call to parser.add_argument() takes care of the default value.