On Wed, Aug 28 2013, Peter Wu wrote: > Makes sense, please test the updated code in > https://git.lekensteyn.nl/upower/?h=hidpp-rework . There is still a FIXME, > currently I assume that the device is charging whenever there is light, but > this is very likely wrong.
Obviously it's wrong :), but guess what, I experimented back then and
determined the values for which the device is considered charging and
discharging. There's a little smiley on the keyboard indicating this
when you press a button.
git log shows it:
if (lux > 200) {
g_object_set (device,
"state", UP_DEVICE_STATE_CHARGING,
"power-supply", TRUE,
NULL);
} else if (lux > 0) {
g_object_set (device,
"state", UP_DEVICE_STATE_DISCHARGING,
"power-supply", TRUE,
NULL);
} else {
g_object_set (device,
"state", UP_DEVICE_STATE_DISCHARGING,
"power-supply", FALSE,
NULL);
}
Anyway, this works much better now I get:
Device: /org/freedesktop/UPower/devices/keyboard_0003o046DoC52Bx0005
native-path:
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.2/0003:046D:C52B.0003/0003:046D:C52B.0005
vendor: Logitech, Inc.
model: K750
serial: 5692B2EC
power supply: no
updated: Wed Aug 28 23:35:00 2013 (10 seconds ago)
has history: yes
has statistics: no
keyboard
present: yes
rechargeable: yes
state: discharging
percentage: 53%
It still is considered as discharging while having enough light so the
smiley is happy and says it's charging. There's a bug here I guess.
Did you see the light meter property too? It's not reported yet at
least.
(I'm sorry I didn't have time to dig through the code yet)
--
Julien Danjou
;; Free Software hacker ; independent consultant
;; http://julien.danjou.info
signature.asc
Description: PGP signature
_______________________________________________ devkit-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/devkit-devel
