-
Notifications
You must be signed in to change notification settings - Fork 471
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
Support for hot-swapping batteries and allowing missing batteries without errors #835
Conversation
This is great! I was just thinking of this the other day, having a battery that may not always be present shouldn't break the entire bar. |
8395b17
to
5bfc298
Compare
Yeah I think this is the best we can do, thank you @Nukesor and @flying7eleven for the clear overview and work on this issue. Perhaps it would be nice to add another format string to use when |
Also could you share a gif or image of what the bar looks like with |
1. Rename `allow_missing_battery` to `allow_missing`. 2. Rename `hidem_missing_battery` to `hide_missing`. 3. Add new `missing_format` string which will be used whenever a battery is missing. 4. Add documentation for some missing configuration variables.
Hey :) On top of that the new I also added a few missing parameters to A gif of a hot-swap with |
LGTM Thanks! |
Hi!
First of all, thanks for providing this project! Looks great and it really has a super low memory/processing power footprint.
This PR is a follow-up to the other two existing battery PRs.
#233
#585
The idea of this PR is to allow several new things, but all visible changes will be hidden behind configurable feature flags.
The PR is based on #585. Thanks to @flying7eleven for providing an easy entry point to this whole issue.
There are three issues, each addressed in it's own commit:
This issue has been solved by introducing a new configuration flag
allow_missing_battery
. If set totrue
, there will be a simple placeholder text instead of crashing the whole bar.This is something that comes from people using the same configuration accross several devices.
I myself, for instance, have two laptops (one at work, one at home) and one of them has a single battery, the other one has two.
This change simply enhances the ergonomics for users with multiple devices.
This needed a few more changes, since some values of the battery were previously only read once during initialization.
Since hot-swapping can change the specs of a battery device, these values now have to be read continuously.
GIF of a hot-swap in action.
GIF of a hot-swap with
hide_missing = true
`