elementary / wingpanel-indicator-power

Wingpanel Power Indicator
GNU General Public License v3.0
24 stars 15 forks source link

Incorrect Battery Percentage Shown #176

Closed kdwk closed 3 years ago

kdwk commented 3 years ago

What Happened

When I plug in an iPad to my PC, the power indicator shows that the 'Computer' is charged to the battery percentage of the iPad.

Screenshot from 2021-03-23 19-20-24 The iPad is charged to 42%, the computer is a desktop.

Expected Behavior

The indicator should show that the iPad is charged to 42%

Steps to Reproduce

  1. Plug in an iPad/ iPhone to a desktop PC
  2. Open wingpanel-indicator-power

Logs

Platform Information

Screenshot from 2021-03-23 19-26-55

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/97359874-incorrect-battery-percentage-shown?utm_campaign=plugin&utm_content=tracker%2F60466177&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F60466177&utm_medium=issues&utm_source=github).
danirabbit commented 3 years ago

Unlike that kid from the Apple commercial, it seems upower identifies this device as a computer! We should probably see if we can be clearer about it being an external device at the least and if there's a way we could try to identify that it is in fact a tablet

kvdz commented 3 years ago

@kdwk i agree with @danrabbit , but i would like to have some more data.

when you plugin an ipad/iphone. could you open up a terminal and execute this command

upower -d

could you post the output in here so we can see what the system thinks it is.

kdwk commented 3 years ago

Here's the output of upower -d

Device: /org/freedesktop/UPower/devices/mouse_dev_E8_1F_35_07_1C_29 native-path: /org/bluez/hci0/dev_E8_1F_35_07_1C_29 model: Designer Mouse serial: E8:1F:35:07:1C:29 power supply: no updated: Thursday, January 01, 1970 AM08:00:00 HKT (1616568510 seconds ago) has history: yes has statistics: no mouse present: yes rechargeable: no state: unknown warning-level: none percentage: 68% icon-name: 'battery-missing-symbolic'

Device: /org/freedesktop/UPower/devices/keyboard_dev_C3_32_8C_27_85_41 native-path: /org/bluez/hci0/dev_C3_32_8C_27_85_41 model: Designer Keyboard serial: C3:32:8C:27:85:41 power supply: no updated: Thursday, January 01, 1970 AM08:00:00 HKT (1616568510 seconds ago) has history: yes has statistics: no keyboard present: yes rechargeable: no state: unknown warning-level: none percentage: 69% icon-name: 'battery-missing-symbolic'

Device: /org/freedesktop/UPower/devices/computer_1_4 native-path: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-4 vendor: Apple_Inc. model: iPad serial: 12acee44f66ac10e9c529b7322213b5f74a0d8b9 power supply: no updated: Wednesday, March 24, 2021 PM02:48:27 HKT (3 seconds ago) has history: yes has statistics: no computer warning-level: none percentage: 53% icon-name: 'battery-good-charging-symbolic'

Device: /org/freedesktop/UPower/devices/DisplayDevice power supply: no updated: Wednesday, March 24, 2021 PM02:28:04 HKT (1226 seconds ago) has history: no has statistics: no unknown warning-level: none icon-name: 'battery-missing-symbolic'

Daemon: daemon-version: 0.99.7 on-battery: no lid-is-closed: no lid-is-present: no critical-action: PowerOff

As you can see, the iPad is categorized as 'computer_1_4', but the model is correctly identified as 'iPad'

kvdz commented 3 years ago

Thank you. Currently we classify based on the device type which in this case is computer. But I think we could make it more smart to show ipad instead. What do you say @danrabbit ?

danirabbit commented 3 years ago

@kvdz yeah it would be nice if we could solve this upstream, but adding a special case to recognize iPad would probably be fine

danirabbit commented 3 years ago

Fixed in master :)