https://bugs.kde.org/show_bug.cgi?id=526768

            Bug ID: 526768
           Summary: Repeated “Keyboard Battery Low (-1% Remaining)”
                    notification for HID++ keyboard that reports only a
                    battery level, not a percentage
    Classification: Plasma
           Product: plasmashell
      Version First 6.7.5
       Reported In:
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Power management & brightness
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: 1.0

Created attachment 196916
  --> https://bugs.kde.org/attachment.cgi?id=196916&action=edit
notifications

SUMMARY
PowerDevil periodically shows a “Keyboard Battery Low (-1% Remaining)”
notification for a Logitech wireless keyboard (Unifying/HID++ 1.0, PID 4023)
whose battery is fine. The device does not report a battery percentage, only a
coarse level, and both the kernel and UPower report that level as “Normal”.
Replacing the batteries with new ones does not change anything. The
notification reappears at irregular intervals during normal use (observed ~28
minutes apart), not only on resume or reconnect.

STEPS TO REPRODUCE
Connect a Logitech wireless keyboard that exposes battery via
hid-logitech-hidpp with only POWER_SUPPLY_CAPACITY_LEVEL (no
POWER_SUPPLY_CAPACITY), e.g. “Logitech Wireless Keyboard PID:4023”.
Use the Plasma session normally.

OBSERVED RESULT
Notification from “Power Management”: Keyboard Battery Low (-1% Remaining) The
battery in “Logitech Wireless Keyboard PID:4023” is running low. Please
recharge the battery. It is shown repeatedly (screenshot attached: two
notifications, 5 and 33 minutes old).

EXPECTED RESULT 
No low battery notification while the device reports a “Normal” battery level.
An unknown percentage (-1) should not be compared against the low-battery
threshold; if anything, the decision should be based on the reported level
(UPower BatteryLevel / WarningLevel).

ADDITIONAL INFORMATION
Kernel sysfs (/sys/class/power_supply/hidpp_battery_0/uevent):
POWER_SUPPLY_STATUS=Discharging POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_CAPACITY_LEVEL=Normal POWER_SUPPLY_SCOPE=Device
POWER_SUPPLY_MODEL_NAME=Wireless Keyboard POWER_SUPPLY_MANUFACTURER=Logitech
(no POWER_SUPPLY_CAPACITY attribute)

upower -d (relevant part): native-path: hidpp_battery_0 model: Logitech
Wireless Keyboard PID:4023 keyboard present: yes rechargeable: yes state:
discharging warning-level: none battery-level: normal percentage: 55% (should
be ignored) icon-name: ‘battery-low-symbolic’

UPower history (/var/lib/upower/history-charge-*) shows that when the device is
(re)enumerated it briefly appears with “0.000 unknown” before settling on
“55.000 discharging”. The device also shows up under different names across
sessions (Wireless_Keyboard, Wireless_Keyboard_PID:4023,
Logitech_Wireless_Keyboard_PID:4023). This may be a second trigger, but the
notification also appears when no UPower history entry and no USB/HID kernel
event was logged in the preceding hour.

UPower emits PropertiesChanged (UpdateTime) for this device every few seconds.

Hypothesis (not verified in the source): the percentage obtained for this
device is -1 (“unknown”, since UPower flags its percentage as to be ignored),
and the low-battery check compares it numerically with the peripheral low
threshold, so -1 < threshold always triggers. Lowering the “peripheral devices
low level” threshold therefore cannot work around it.

Workaround: disable the “Peripheral battery low” popup in the Power Management
notification settings, which also disables it for all other peripherals.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 44 KDE Plasma Version: 6.7.5
(powerdevil-6.7.5-1.fc44, plasma-workspace-6.7.5-1.fc44) KDE Frameworks
Version: 6.30.0 (kf6-solid-6.30.0-1.fc44) Qt Version: 6.11.2 UPower: 1.91.4
Kernel Version: 7.2.5-200.fc44.x86_64 Graphics Platform: X11

Possibly related: bug 495882 (low battery notification for peripheral shows
wrong device type), bug 506732 (peripheral battery level not reflected
correctly).

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to