hal/hald/linux2/addons addon-hid-ups.c,1.8,1.9
David Zeuthen
david at freedesktop.org
Fri Jul 29 13:58:06 PDT 2005
Update of /cvs/hal/hal/hald/linux2/addons
In directory gabe:/tmp/cvs-serv5243/hald/linux2/addons
Modified Files:
addon-hid-ups.c
Log Message:
2005-07-29 David Zeuthen <davidz at redhat.com>
* hald/linux2/addons/addon-hid-ups.c: This one for UPS's (which
are always measured in percent, so no division needed). I think
that's all of the capability battery devices now. All I have to do
is wait for the next release of HAL, and i can depend on that new
version (but I'm guessing it'll be a long wait :-). Patch from
Richard Hughes <richard at hughsie.com>.
Index: addon-hid-ups.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/addons/addon-hid-ups.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- addon-hid-ups.c 29 Jul 2005 20:32:57 -0000 1.8
+++ addon-hid-ups.c 29 Jul 2005 20:58:04 -0000 1.9
@@ -160,6 +160,8 @@
case UPS_REMAINING_CAPACITY:
libhal_device_set_property_int (
ctx, udi, "battery.charge_level.current", uref.value, &error);
+ libhal_device_set_property_int (
+ ctx, udi, "battery.charge_level.percentage", uref.value, &error);
libhal_device_set_property_string (
ctx, udi, "battery.charge_level.unit", "percent", &error);
break;
@@ -297,6 +299,8 @@
case UPS_REMAINING_CAPACITY:
libhal_device_set_property_int (
ctx, udi, "battery.charge_level.current", ev[i].value, &error);
+ libhal_device_set_property_int (
+ ctx, udi, "battery.charge_level.percentage", ev[i].value, &error);
break;
case UPS_RUNTIME_TO_EMPTY:
More information about the hal-commit
mailing list