Skip to content

Conversation

@ES-Alexander
Copy link
Contributor

@ES-Alexander ES-Alexander commented Jan 23, 2026

  • Reorders the threshold/state indicators to have high at the top (which feels more logical, like the battery is a fuel tank)
  • Rounds to lower precision so debouncing doesn't hang endlessly on small value changes from sensor noise
  • Removes the unused critical threshold level (bumping the other levels down, so there's no "high" threshold), and updates the UI accordingly
  • Fixes the color picker to actually be dark, since native HTML input elements don't support the theme=dark specifier
    • This uses a vuetify color picker that doesn't support direct value specifying apparently, not sure if that's a problem 🤷‍♂️
    • This probably needs updating elsewhere as well - maybe we should have a reusable component for it?
  • Adds a reset button to restore the default colors and voltage levels

Before:
Screenshot 2026-01-24 at 3 55 57 am

After:
Screenshot 2026-01-24 at 4 13 39 am


Decided to try Cursor. Some things were faster to describe than they would have been to type/develop manually, but I'm very much still learning how to use it, and it took a few wrong turns, so the update took much longer than anticipated 😅

Granted, I wasn't expecting to have to debug the voltage colour feature not working at all for my setup, and that's where the main complexity/investigation ended up (which turned out to be a debouncing issue).
I like the idea that debouncing waits for stability before choosing a colour, but I'm a little unsure whether it should be replaced with throttling instead to avoid the possibility of the colour never changing because the voltage is never stable. I suppose that mostly depends on how variable we expect the voltage to be.

Ideally the debouncing would happen at the threshold level rather than the number level, but that's probably quite a lot of code to implement for a problem that may not actually eventuate...

@ES-Alexander ES-Alexander force-pushed the improve-battery-color-config branch from effb745 to b9b376e Compare January 23, 2026 19:51
@rafaellehmkuhl
Copy link
Member

Seems good to me, also from a code perspective.
@ArturoManzoli can you take a look at that to see if it makes sense with your original view of the feature?

Copy link
Contributor

@ArturoManzoli ArturoManzoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code-wise it's working very well, and the interface changes improved the widget.

I would suggest some changes, tho:

  • (1) The “high battery” label feels a bit isolated and, at least for me, doesn’t clearly convey its meaning. To keep things consistent and better communicate the high-battery range, I’d suggest using a text field with a fixed value, something like:
    “High battery: above 18.6 V”
  • (2) A more direct label using words like use or enable might be clearer, for example: "Enable active icon color" or "Use battery level color indication"
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants