Open castrojo opened 1 year ago
Do you by any chance use a wireless mouse?
My machine without battery returns None
by the following command. Can you run this command and post the output?
echo -e "import psutil\nprint(psutil.sensors_battery())" | python
And output of ls /sys/class/power_supply/*
Probably there is a device with a battery being used, that is recognized as a "main" battery by the script.
I do have a wireless mouse!
echo -e "import psutil\nprint(psutil.sensors_battery())" | python
sbattery(percent=23, secsleft=<BatteryTime.POWER_TIME_UNKNOWN: -1>, power_plugged=False)
and
ls /sys/class/power_supply/*
capacity model_name scope type
device online serial_number uevent
hwmon7 power status voltage_now
manufacturer powers subsystem wakeup78
Can you do a grep -r . /sys/class/power_supply/
too? Problem with this stuff is that there quiet a few of these kind of devices with a battery, that can show up. So you probably want some kind of filter or something.
I have one item in there:
❯ ls -l
lrwxrwxrwx@ - root 5 Oct 13:11 hidpp_battery_0 -> ../../devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:10:00.0/usb5/5-4/5-4:1.2/0003:046D:C539.0008/0003:046D:4079.0011/power_supply/hidpp_battery_0
For example TLP is doing the same, it's ignoring exactly the one you are posting in their "ignore" list.
# power supplies: ignore MacBook Pro 2017 sbs-charger and hid devices
readonly RE_PS_IGNORE='sbs-charger|hidpp_battery|hid-'
Maybe we should skip the battery thing in bluefin entirely and just avoid having to special case a bunch of hardware?
Can you verify that ublue-update runs correctly if you set min_battery_percent = 0
in the config toml? That should "skip" the check.
Alright that seems to work!
unfortunately this is an upstream issue with psutil, the relevant PR is here: https://github.com/giampaolo/psutil/pull/2305
On my bluefin:38 machine: