Bug 483510 - Battery widget shows charging in battery icon, even when the laptop is not plugged in
Summary: Battery widget shows charging in battery icon, even when the laptop is not pl...
Status: REPORTED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Battery Monitor (show other bugs)
Version: 6.0.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-14 04:53 UTC by ljh.arthur
Modified: 2024-04-09 23:38 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ljh.arthur 2024-03-14 04:53:28 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
Sometimes, the battery icon in the KDE tray menu still displays the charging icon after unplugging the charging cable.
Move the mouse up, and the pop-up label shows that the charger is connected, but it is still being discharged. The power supply is insufficient and cannot be charged.
Plug in the charger again and it returns to normal, but the charging icon is still displayed when you unplug it again. Whenever this problem occurs, it will only recover after restarting. But I'm not sure how to reproduce this problem, it seems to be a random


STEPS TO REPRODUCE
1. Plug charger
2. unplug charger

OBSERVED RESULT

The battery icon shows charging

EXPECTED RESULT

show discharged

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Archlinux KDE Plasma Wayland
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION

```
upower -d when bug occurred
Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               SCUD
  model:                R14B06W
  serial:               MB100000006AE25708AV
  power supply:         yes
  updated:              2024年03月14日 星期四 12时51分49秒 (20 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              14.02 Wh
    energy-empty:        0 Wh
    energy-full:         51.93 Wh
    energy-full-design:  56 Wh
    energy-rate:         8.79 W
    voltage:             14.716 V
    charge-cycles:       N/A
    time to empty:       1.6 hours
    percentage:          26%
    capacity:            92.7321%
    technology:          lithium-ion
    icon-name:          'battery-low-symbolic'
  History (charge):
    1710391909  26.000  discharging
  History (rate):
    1710391909  8.790   discharging
    1710391897  8.630   discharging
    1710391867  9.640   discharging
    1710391837  9.240   discharging

Device: /org/freedesktop/UPower/devices/line_power_ADP1
  native-path:          ADP1
  power supply:         yes
  updated:              2024年03月14日 星期四 11时53分28秒 (3521 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/line_power_ucsi_source_psy_USBC000o001
  native-path:          ucsi-source-psy-USBC000:001
  power supply:         yes
  updated:              2024年03月14日 星期四 12时37分08秒 (901 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:              2024年03月14日 星期四 12时36分45秒 (924 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:              2024年03月14日 星期四 12时51分49秒 (20 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               discharging
    warning-level:       none
    energy:              14.02 Wh
    energy-full:         51.93 Wh
    energy-rate:         8.79 W
    charge-cycles:       N/A
    time to empty:       1.6 hours
    percentage:          26%
    icon-name:          'battery-low-symbolic'

Daemon:
  daemon-version:  1.90.2
  on-battery:      no
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: HybridSleep

```
Comment 1 ljh.arthur 2024-03-14 05:08:52 UTC
Guys I found a way to reproduce it, it is related to hibernation in Archlinux.
I set up hibernation recovery
(Add swap uuid to /etc/default/grub, and add the resume hook in mkinitcpio.conf,  copy the memory to the swap partition when hibernating, and recover when the system boots) 
1. Close the lid of the laptop when it is not charging (I set hibernating when the lid is closed)
2. Keep the lid closed and plug in the charger
3. Open the cover, turn on the phone, wait for a while, and then pull out the charger.
Comment 2 ljh.arthur 2024-03-14 05:28:58 UTC
It seems that this problem can be triggered by rebooting while keeping the charger plugged in, and then unplugging it after entering the system. No hibernation is required.
Comment 3 Natalie Clarius 2024-04-09 23:38:28 UTC
(In reply to ljh.arthur from comment #2)
> It seems that this problem can be triggered by rebooting while keeping the
> charger plugged in, and then unplugging it after entering the system. No
> hibernation is required.

What exactly do you mean by "after entering the system"? After logging into Plasma? I can't reproduce it with these steps.