The DisplayProgressBar method in lcd_comm.py calculates the filled width using the raw value rather than the value's offset from min_value:
# Current (line 359)
bar_filled_width = (value / (max_value - min_value) * width) - 1
# Should be
bar_filled_width = ((value - min_value) / (max_value - min_value) * width) - 1
When min_value is 0 (the default), this has no effect — which is why it's gone unnoticed. But for any bar with a non-zero minimum (e.g. a temperature bar with min=25, max=95), the fill is wrong:
| value |
min |
max |
buggy fill |
correct fill |
| 25 |
25 |
95 |
36% |
0% |
| 60 |
25 |
95 |
86% |
50% |
| 95 |
25 |
95 |
136% (clamped) |
100% |
DisplayRadialProgressBar already does this correctly on line 560:
pct = (value - min_value) / (max_value - min_value)
Happy to submit a one-line PR if you'd like.
The
DisplayProgressBarmethod inlcd_comm.pycalculates the filled width using the raw value rather than the value's offset frommin_value:When
min_valueis 0 (the default), this has no effect — which is why it's gone unnoticed. But for any bar with a non-zero minimum (e.g. a temperature bar with min=25, max=95), the fill is wrong:DisplayRadialProgressBaralready does this correctly on line 560:Happy to submit a one-line PR if you'd like.