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

ublue-update failing hardware check on battery of hid device #285

Closed
daegalus opened this issue Sep 11, 2023 · 3 comments
Closed

ublue-update failing hardware check on battery of hid device #285

daegalus opened this issue Sep 11, 2023 · 3 comments

Comments

@daegalus
Copy link

Per our conversation in discord.

On my system, ublue-update fails to run because the battery hardware check is noticing the battery of my bluetooth keyboard.

  /sys/class/power_supply                                                                                                                                                                                              at  21:37:09
❯ ls
hid-34:88:5d:42:f7:c8-battery

Digging into the folder, we find the following:

  /sys/class/power_supply/hid-34:88:5d:42:f7:c8-battery                                                                                                                                                                at  21:41:01
❯ cat device/input/input28/name 
Keyboard K380 Keyboard

The workaround solution was to set min_battery_percent in /etc/ublue-update/ublue-update.toml to 0, as suggested by Gerblesh.

This might be an upstream issue with psutil not filtering out hid- batteries, but needs more investigation.

@RodoMa92
Copy link
Contributor

Yeah, I've got a similar issue three days ago, probably for the same source (I've got a bluetooth keyboard + mouse combo with battery reporting). I'll try to dig further if I can reproduce it again.

@RodoMa92
Copy link
Contributor

RodoMa92 commented Sep 13, 2023

Oh, found the issue, it's here: https://github.com/giampaolo/psutil/blob/77e5b7445748d30d22c0e3b2e651414da96a88b4/psutil/_pslinux.py#L1476

They are checking if the nodes in the folder has the text 'battery' in them in the folder /sys/class/power_supply, but that includes also batteries reported from bluetooth hardware peripherals (since they have the format of hid-<mac address>-battery), so they also match.

I'll see if I can pull additional information from a battery source, I might already have an idea for it.

@RodoMa92
Copy link
Contributor

PR is open: giampaolo/psutil#2305

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

No branches or pull requests

3 participants