Skip to content
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

fix: min_battery_percent = 0 now works to "skip" battery check #89

Merged
merged 1 commit into from
Oct 28, 2023

Conversation

reyemxela
Copy link
Contributor

Until giampaolo/psutil#2305 is merged, machines with no battery can fail the check if they have external devices that are reporting battery levels (#79).

In my case, my wireless Logitech headphones report 0% battery if the dongle is plugged in but the headphones are off, and even setting min_battery_percent = 0 in the config doesn't work, because 0 is not greater than 0.

This little tweak just makes it so 0 values pass the check correctly.

Could make a special case for min_battery_percent = 0 to skip the check entirely instead, not sure which would be more preferred.

@reyemxela reyemxela changed the title min_battery_percent = 0 now works to "skip" battery check fix: min_battery_percent = 0 now works to "skip" battery check Oct 25, 2023
Copy link
Contributor

@bobslept bobslept left a comment

Choose a reason for hiding this comment

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

Nice find! Seems the change makes total sense. I've added @gerblesh as a reviewer for the PR.

Thanks for your contribution 💙

@gerblesh
Copy link
Collaborator

LGTM

@gerblesh gerblesh added this pull request to the merge queue Oct 28, 2023
Merged via the queue into ublue-os:main with commit c1f7355 Oct 28, 2023
2 of 4 checks passed
@reyemxela reyemxela deleted the min_batt_zero_skip branch October 28, 2023 13:03
@bobslept bobslept mentioned this pull request Nov 3, 2023
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