K750 fixes in hidpp-rework branch
Julien Danjou
julien at danjou.info
Wed Aug 28 14:37:12 PDT 2013
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/devkit-devel/attachments/20130828/5983a36c/attachment.pgp>
More information about the devkit-devel
mailing list