Okay, I found out some things:

1. If the ac adapter is plugged in:

j...@xylakant:/proc/acpi/battery/BAT0$ lshal | grep ac_adapter
udi = '/org/freedesktop/Hal/devices/computer_power_supply_ac_adapter_ADP1'
  ac_adapter.present = true  (bool)
  info.capabilities = {'ac_adapter'} (string list)
  info.category = 'ac_adapter'  (string)
  info.udi = 
'/org/freedesktop/Hal/devices/computer_power_supply_ac_adapter_ADP1'  (string)

j...@xylakant:/proc/acpi/battery/BAT0$ lshal | grep battery
udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0'
  battery.charge_level.current = 33399  (0x8277)  (int)
  battery.charge_level.design = 57720  (0xe178)  (int)
  battery.charge_level.last_full = 45299  (0xb0f3)  (int)
  battery.charge_level.percentage = 73  (0x49)  (int)
  battery.charge_level.rate = 27772  (0x6c7c)  (int)
  battery.is_rechargeable = true  (bool)
  battery.model = 'Modelxxx'  (string)
  battery.present = true  (bool)
  battery.rechargeable.is_charging = true  (bool)
  battery.rechargeable.is_discharging = false  (bool)
  battery.remaining_time = 1542  (0x606)  (int)
  battery.reporting.current = 3009  (0xbc1)  (int)
  battery.reporting.design = 5200  (0x1450)  (int)
  battery.reporting.last_full = 4081  (0xff1)  (int)
  battery.reporting.rate = 2502  (0x9c6)  (int)
  battery.reporting.technology = 'Li-ion'  (string)
  battery.reporting.unit = 'mAh'  (string)
  battery.serial = 'SN'  (string)
  battery.technology = 'lithium-ion'  (string)
  battery.type = 'primary'  (string)
  battery.vendor = 'Vendor12345678901234567890'  (string)
  battery.voltage.current = 12389  (0x3065)  (int)
  battery.voltage.design = 11100  (0x2b5c)  (int)
  battery.voltage.unit = 'mV'  (string)
  info.capabilities = {'battery'} (string list)
  info.category = 'battery'  (string)
  info.udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0'  
(string)

2. If the ac adapter is unplugged, I get:

j...@xylakant:/proc/acpi/battery/BAT0$ lshal | grep ac_adapter
udi = '/org/freedesktop/Hal/devices/computer_power_supply_ac_adapter_ADP1'
  ac_adapter.present = false  (bool)
  info.capabilities = {'ac_adapter'} (string list)
  info.category = 'ac_adapter'  (string)
  info.udi = 
'/org/freedesktop/Hal/devices/computer_power_supply_ac_adapter_ADP1'  (string)

j...@xylakant:/proc/acpi/battery/BAT0$ lshal | grep battery
udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0'
  battery.charge_level.current = 33843  (0x8433)  (int)
  battery.charge_level.design = 57720  (0xe178)  (int)
  battery.charge_level.last_full = 45299  (0xb0f3)  (int)
  battery.charge_level.percentage = 74  (0x4a)  (int)
  battery.charge_level.rate = 0  (0x0)  (int)
  battery.is_rechargeable = true  (bool)
  battery.model = 'Modelxxx'  (string)
  battery.present = true  (bool)
  battery.rechargeable.is_charging = false  (bool)
  battery.rechargeable.is_discharging = false  (bool)
  battery.reporting.current = 3049  (0xbe9)  (int)
  battery.reporting.design = 5200  (0x1450)  (int)
  battery.reporting.last_full = 4081  (0xff1)  (int)
  battery.reporting.rate = -1  (0xffffffff)  (int)
  battery.reporting.technology = 'Li-ion'  (string)
  battery.reporting.unit = 'mAh'  (string)
  battery.serial = 'SN'  (string)
  battery.technology = 'lithium-ion'  (string)
  battery.type = 'primary'  (string)
  battery.vendor = 'Vendor12345678901234567890'  (string)
  battery.voltage.current = 12425  (0x3089)  (int)
  battery.voltage.design = 11100  (0x2b5c)  (int)
  battery.voltage.unit = 'mV'  (string)
  info.capabilities = {'battery'} (string list)
  info.category = 'battery'  (string)
  info.udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0'  
(string)

So you can see, that HAL recognizes the presence of the ac adapter
correctly, while it doesn't recognize the correct state of the battery.
If the battery is charging, all is okay, but if it's discharging, the
key

 battery.rechargeable.is_discharging = false  (bool)

isn't set correctly. If I do this manually by

sudo hal-set-property --udi
/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0 --key
battery.rechargeable.is_discharging --bool true

this hasn't any effect on the gnome battery indicator (even after
killing the panel) and the is reset to the wrong value "false" after
half a minute or so.

My (humble) opinion is, that hal is setting this key by reading out the
file /proc/acpi/battery/state which contains the wrong value

j...@xylakant:/proc/acpi/battery/BAT0$ cat state
present:                 yes
capacity state:          ok
charging state:          charged
present rate:            2078 mA
remaining capacity:      2777 mAh
present voltage:         11498 mV

where the 3rd lines says, that the battery (while the ac adapter is
unplugged) is "charged", so it's neither charging nor uncharging, so
that the "hal-get-proberty"-values just make perfect sense. But I don't
know how to manipulate whats written into this file and I don't want to
edit it manually, because even root has read access.

So what to do?

-- 
battery indicator is wrong
https://bugs.launchpad.net/bugs/455786
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is a bug assignee.

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to