DisplayDevice state is unknown when battery is in pending-charge state
The pending-charge state is ignored when calculating the state for the DisplayDevice. This results in the DisplayDevice's icon-name being set to battery-missing-symbolic and the wrong icon being presented on the UI.
This was reproduced on Endless OS with both upower 0.99.4 and 0.99.8.
upower --dump shown bellow.
endless@endless:~$ upower --dump Device: /org/freedesktop/UPower/devices/line_power_AC0 native-path: AC0 power supply: yes updated: Mon 15 Oct 2018 02:46:19 PM PDT (4293 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: ASUSTeK model: ASUS Battery power supply: yes updated: Mon 15 Oct 2018 03:56:20 PM PDT (92 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: pending-charge warning-level: none energy: 33.234 Wh energy-empty: 0 Wh energy-full: 34.2 Wh energy-full-design: 38 Wh energy-rate: 2.052 W voltage: 7.6 V percentage: 97% capacity: 90% technology: lithium-ion icon-name: 'battery-full-charging-symbolic' Device: /org/freedesktop/UPower/devices/DisplayDevice power supply: yes updated: Mon 15 Oct 2018 03:10:20 PM PDT (2852 seconds ago) has history: no has statistics: no battery present: yes state: unknown warning-level: none energy: 33.234 Wh energy-full: 34.2 Wh energy-rate: 2.052 W percentage: 97% icon-name: 'battery-missing-symbolic' Daemon: daemon-version: 0.99.4 on-battery: no lid-is-closed: no lid-is-present: yes critical-action: PowerOff