SUMMARY Trying to change the value of "Stop charging at" doesn't work anymore. STEPS TO REPRODUCE 1. Go to System settings -> Power management -> Advanced Power Settings 2. Change "Stop charging at" to any value 3. Click apply and introduce password when asked 4. Close system settings 5. Open system settings again and check the value of "Stop charging at" OBSERVED RESULT The limit is not changed/saved. I'm not 100% sure if this started to happen after upgrading to the Plasma 5.27 Beta, to Frameworks 5.102.0, or due to recent kernel upgrades. I can still change the limit manually by setting the value in /sys/class/power_supply/BAT0. After doing that, system settings shows the updated value. So it looks like it can read but not write the setting. The other limit, "Start charging only once below", is saved correctly. EXPECTED RESULT Both limits should be saved correctly. Also, would be nice to warn the user if there was an error trying to update the values. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.26.90 KDE Frameworks Version: 5.102.0 Qt Version: 5.15.8 Kernel Version: 6.1.6-arch1-3 (64-bit) Graphics Platform: Wayland Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz Memory: 15.4 GiB of RAM Graphics Processor: Mesa Intel® Xe Graphics Manufacturer: LENOVO Product Name: 20XYCTO1WW System Version: ThinkPad X1 Yoga Gen 6
Reverting this fixes the issue for me: https://invent.kde.org/plasma/powerdevil/-/commit/a002ab4718760dfae156bd8fe8a17c59b0f09182 As additional info, my laptop has a pen with some battery that charges when stored in the laptop. It appears as wacom_battery_0 in /sys/class/power_supply. Maybe after that commit, powerdevil tries to changes the limit on the pen instead of the laptop's battery?
*** This bug has been marked as a duplicate of bug 450551 ***
I don't think it's the same bug.
My mistake, sorry
*** Bug 464650 has been marked as a duplicate of this bug. ***
As requested in matrix. $ upower -d Device: /org/freedesktop/UPower/devices/line_power_AC native-path: AC power supply: yes updated: Thu 26 Jan 2023 10:45:16 (8045 seconds ago) has history: no has statistics: no line-power warning-level: none online: yes icon-name: 'ac-adapter-symbolic' Device: /org/freedesktop/UPower/devices/battery_BAT0 native-path: BAT0 vendor: Sunwoda model: 5B10W13975 serial: 24869 power supply: yes updated: Thu 26 Jan 2023 12:59:02 (19 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: pending-charge warning-level: none energy: 48.72 Wh energy-empty: 0 Wh energy-full: 56.99 Wh energy-full-design: 57 Wh energy-rate: 0 W voltage: 17.402 V charge-cycles: 172 percentage: 85% capacity: 99.9825% technology: lithium-polymer icon-name: 'battery-full-charging-symbolic' Device: /org/freedesktop/UPower/devices/battery_wacom_battery_0 native-path: wacom_battery_0 model: Wacom HID 527A power supply: no updated: Thu 01 Jan 1970 01:00:00 (1674734361 seconds ago) has history: yes has statistics: yes keyboard present: yes rechargeable: yes state: unknown warning-level: none percentage: 0% icon-name: 'battery-missing-symbolic' History (charge): 1674734361 0.000 unknown History (rate): 1674734361 0.000 unknown Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o001 native-path: ucsi-source-psy-USBC000:001 power supply: yes updated: Thu 26 Jan 2023 10:45:16 (8045 seconds ago) has history: no has statistics: no line-power warning-level: none online: no icon-name: 'ac-adapter-symbolic' Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o002 native-path: ucsi-source-psy-USBC000:002 power supply: yes updated: Thu 26 Jan 2023 10:45:21 (8040 seconds ago) has history: no has statistics: no line-power warning-level: none online: no icon-name: 'ac-adapter-symbolic' Device: /org/freedesktop/UPower/devices/DisplayDevice power supply: yes updated: Thu 26 Jan 2023 12:36:01 (1400 seconds ago) has history: no has statistics: no battery present: yes state: pending-charge warning-level: none energy: 48.72 Wh energy-full: 56.99 Wh energy-rate: 0 W charge-cycles: N/A percentage: 85% icon-name: 'battery-full-charging-symbolic' Daemon: daemon-version: 1.90.0 on-battery: no lid-is-closed: yes lid-is-present: yes critical-action: PowerOff $ cat /sys/class/power_supply/BAT0/type Battery $ cat /sys/class/power_supply/wacom_battery_0/type Battery
After using the pen at least once (needs to touch the screen to report battery status) Device: /org/freedesktop/UPower/devices/battery_wacom_battery_0 native-path: wacom_battery_0 model: Wacom HID 527A power supply: no updated: Thu 26 Jan 2023 13:04:36 (11 seconds ago) has history: yes has statistics: yes keyboard present: yes rechargeable: yes state: fully-charged warning-level: none percentage: 100% icon-name: 'battery-full-charged-symbolic' History (charge): 1674734675 100.000 fully-charged
FWICT the issue is that the helper stops if it fails to set the threshold on a battery instead of continuing with the other batteries.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/131
Patch works for me ;)
Git commit e0a74cc3bd358abeb64b9a3857c00c1d71802553 by Fabian Vogt. Committed on 26/01/2023 at 13:13. Pushed by fvogt into branch 'master'. chargethresholdhelper: Filter out batteries without thresholds early Previously, getBatteries() returned all batteries, even those without support for thresholds. While getthreshold simply skipped those where reading fails, setthreshold exited early on the first failure, leaving the remaining batteries untouched. By already performing filtering in getBatteries(), this should now behave more consistently and work also if not all batteries support thresholds. M +14 -3 daemon/chargethresholdhelper.cpp https://invent.kde.org/plasma/powerdevil/commit/e0a74cc3bd358abeb64b9a3857c00c1d71802553
Git commit b2e33beeed1a7ba60fb20a784c3209f97b887b8f by Fabian Vogt. Committed on 26/01/2023 at 13:50. Pushed by fvogt into branch 'Plasma/5.27'. chargethresholdhelper: Filter out batteries without thresholds early Previously, getBatteries() returned all batteries, even those without support for thresholds. While getthreshold simply skipped those where reading fails, setthreshold exited early on the first failure, leaving the remaining batteries untouched. By already performing filtering in getBatteries(), this should now behave more consistently and work also if not all batteries support thresholds. (cherry picked from commit e0a74cc3bd358abeb64b9a3857c00c1d71802553) M +14 -3 daemon/chargethresholdhelper.cpp https://invent.kde.org/plasma/powerdevil/commit/b2e33beeed1a7ba60fb20a784c3209f97b887b8f
Created attachment 156238 [details] There are no settings. This commit disables the battery limit setting. Operating System: ROSA Fresh Desktop 2021.1 KDE Plasma Version: 5.27.0 KDE Frameworks Version: 5.103.0 Qt Version: 5.15.5 Kernel Version: 6.1.11-generic-4rosa2021.1-x86_64 (64-bit) Graphics Platform: Wayland Processors: 16 × 11th Gen Intel® Core™ i7-11800H @ 2.30GHz Memory: 38.9 ГиБ of RAM Graphics Processor: Mesa Intel® UHD Graphics Manufacturer: ASUSTeK COMPUTER INC. Product Name: ROG Zephyrus M16 GU603HE_GU603HE System Version: 1.0
Created attachment 156239 [details] Removed this commit. Removed this commit by building the package with the parameter Patch1: https://invent.kde.org/plasma/powerdevil/-/commit/b2e33beeed1a7ba60fb20a784c3209f97b887b8.patch %prep %setup -n %{oname}-%{version} %patch1 -p1 -R
What's the output of ls -l /sys/class/power_supply/*/*threshold*? I suspect the battery either has a start or stop threshold, but not both.
(In reply to Victor Ryzhykh from comment #13) > Created attachment 156238 [details] > There are no settings. > > This commit disables the battery limit setting. > Settings are not available on this tab. but managed to enable the limit with package asusctl. Package asusctl works correctly in both cases. https://gitlab.com/asus-linux/asusctl
(In reply to Fabian Vogt from comment #15) > What's the output of ls -l /sys/class/power_supply/*/*threshold*? > > I suspect the battery either has a start or stop threshold, but not both. victor@asus-rog ~ $ ls -l /sys/class/power_supply/*/*threshold -rw-r--r-- 1 root root 4096 фев 14 21:38 /sys/class/power_supply/BAT0/charge_control_end_threshold victor@asus-rog ~ $ su - Пароль: asus-rog ~ # ls -l /sys/class/power_supply/*/*threshold -rw-r--r-- 1 root root 4096 фев 14 21:38 /sys/class/power_supply/BAT0/charge_control_end_threshold asus-rog ~ #
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/135
(In reply to Victor Ryzhykh from comment #17) > (In reply to Fabian Vogt from comment #15) > > What's the output of ls -l /sys/class/power_supply/*/*threshold*? > > > > I suspect the battery either has a start or stop threshold, but not both. > > victor@asus-rog ~ $ ls -l /sys/class/power_supply/*/*threshold > -rw-r--r-- 1 root root 4096 фев 14 21:38 > /sys/class/power_supply/BAT0/charge_control_end_threshold > victor@asus-rog ~ $ su - > Пароль: > asus-rog ~ # ls -l /sys/class/power_supply/*/*threshold > -rw-r--r-- 1 root root 4096 фев 14 21:38 > /sys/class/power_supply/BAT0/charge_control_end_threshold > asus-rog ~ # Ok, so my suspicion was correct. Please try https://invent.kde.org/plasma/powerdevil/-/merge_requests/135.
(In reply to Fabian Vogt from comment #19) > Ok, so my suspicion was correct. Please try > https://invent.kde.org/plasma/powerdevil/-/merge_requests/135. /builddir/build/BUILD/powerdevil-5.27.0/daemon/chargethresholdhelper.cpp:67:16: error: expected identifier before '!' token
(In reply to Victor Ryzhykh from comment #20) > (In reply to Fabian Vogt from comment #19) > > Ok, so my suspicion was correct. Please try > > https://invent.kde.org/plasma/powerdevil/-/merge_requests/135. > > /builddir/build/BUILD/powerdevil-5.27.0/daemon/chargethresholdhelper.cpp:67: > 16: error: expected identifier before '!' token Fixed.
(In reply to Fabian Vogt from comment #21) > (In reply to Victor Ryzhykh from comment #20) > > (In reply to Fabian Vogt from comment #19) > > > Ok, so my suspicion was correct. Please try > > > https://invent.kde.org/plasma/powerdevil/-/merge_requests/135. > > > > /builddir/build/BUILD/powerdevil-5.27.0/daemon/chargethresholdhelper.cpp:67: > > 16: error: expected identifier before '!' token > > Fixed. So good, now it works.
Created attachment 156245 [details] So good, now it works. So good, now it works.
Git commit d4fff0747290575705c09a2bfe265390d857d90a by Fabian Vogt. Committed on 15/02/2023 at 16:04. Pushed by fvogt into branch 'master'. Only skip batteries if neither start or stop thresholds are available Previously only those batteries which had both thresholds available were returned. M +4 -7 daemon/chargethresholdhelper.cpp https://invent.kde.org/plasma/powerdevil/commit/d4fff0747290575705c09a2bfe265390d857d90a
Git commit eed8ef2f06f29b1c8983b3af950349b7d603bb7f by Fabian Vogt. Committed on 15/02/2023 at 16:09. Pushed by fvogt into branch 'Plasma/5.27'. Only skip batteries if neither start or stop thresholds are available Previously only those batteries which had both thresholds available were returned. (cherry picked from commit d4fff0747290575705c09a2bfe265390d857d90a) (cherry picked from commit 9cc6650a0b2946c80b62950f57ec6b50cb7aaed8) M +3 -6 daemon/chargethresholdhelper.cpp https://invent.kde.org/plasma/powerdevil/commit/eed8ef2f06f29b1c8983b3af950349b7d603bb7f