-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pro - Progress bar values are about an order of magnitude off #244
Comments
Are you sure to use int everywhere and not floats ? Sliders support both int and floats:
if you construct the card with integer, it will have internally: with floats, it will have internally: This distinction is important for ESP-DASH to know how to output the numbers, and which callback to call between:
Rule: always use the same types: int, or float, but not a mix of them otherwise it will change the card type at runtime. Note: this might not be related to your issue though, but just something to check. |
I definitely used all ints in my original code, but when testing a float in update() I didn't change the min and max to floats as well |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Still seeing this issue |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Bump |
yes, it is either everything floats (update ,callback AND definition), or everything in ints. I do not have this behaviour in chrome and safari... really weird... |
That's interesting, if it isn't reproducible for anyone else it must be with my build environment or browser, I'll see if I can run some more tests |
Ah, now I got to understand your issue. @elliotmatson Please send a message over [email protected] to create a ticket, I'll reply back to you with a fix there. I believe we can fix it today itself. |
Just sent, thanks so much! |
@mathieucarbou We were so focused on blaming the int and floats haha but the issue was that UI calculates the % of raw value in the specified range. So what @elliotmatson thought was off-value was just the percentage in range of 0-100. As mentioned on mail, the best fix is to keep the percentage but update the symbol string as well to show raw value. For example: String symbol_str = "% (" + String(value) + "KB / 1024KB)";
progress_card.update(value, symbol_str.c_str()); |
Describe the bug
Progress bar is showing something close to the update value / 10
To Reproduce
Steps to reproduce the behavior:
Results in:
Have tested with ints and floats, and finally with a constant. It doesn't seem to be exactly inputVal/10, but it's typically pretty close.
Logging the value of inputVal immediately before calling update() verifies that the expected value is correct.
Expected behavior
Should show 20
Versions
ESP-DASH Pro @ 4.6.0
bblanchon/ArduinoJson @ ^7.1.0
mathieucarbou/AsyncTCP @ 3.2.12
mathieucarbou/ESPAsyncWebServer @ 3.2
The text was updated successfully, but these errors were encountered: