Add timeToFull/timeToEmpty, recall notice and FullyCharged to Solid::Battery
Review Request #117339 - Created April 2, 2014 and submitted
Information | |
---|---|
Kai Uwe Broulik | |
solid | |
master | |
117542, 117540, 118558 | |
Reviewers | |
solid | |
afiestas |
This adds the following functionality to Solid::Battery: - timeToFull and timeToEmpty (at the moment provided by PowerDevil but for all batteries combined, this patch does it individually for each) - rename isPlugged to isPresent (as plugged always confused me - it has nothing to do with whether AC is plugged in but if the battery is "present in its bay", it's also the name of the UPower iface) - FullyCharged battery state, we cannot rely on the battery being 100%, and since the info is provided by UPower (not on HAL), why not use it - RecallVendor/RecallUrl when a battery has been recalled by the vendor, currently provided/handled by PowerDevil - Serial number of the battery Sorry for the hard to read patch but I also re-ordered some methods to have the order in all implementations and headers the same.
Compiles, solid-hardware5 details /org/freedesktop/UPower/devices/battery_BAT0 reports: udi = '/org/freedesktop/UPower/devices/battery_BAT0' parent = '/org/freedesktop/UPower' (string) vendor = 'ASUSTeK' (string) product = 'UX31-35' (string) description = 'Lithium Ion Battery' (string) Battery.present = true (bool) Battery.type = 'PrimaryBattery' (0x3) (enum) Battery.chargePercent = 31 (0x1f) (int) Battery.capacity = 83 (0x53) (int) Battery.rechargeable = true (bool) Battery.powerSupply = true (bool) Battery.chargeState = 'Discharging' (0x2) (enum) Battery.timeToEmpty = 5105 (0x13f1) (qlonglong) Battery.timeToFull = 0 (0x0) (qlonglong) Battery.energy = '13.223' (string) ? dunno why it says string, it's double everywhere Battery.energyRate = '9.324' (string) ? same Battery.voltage = '7.4' (string) ? same Battery.recalled = false (bool) Battery.recallVendor = '' (string) Battery.recallUrl = '' (string) Battery.serial = '' (string)
Issues
- 2
- 0
- 0
- 2
Description | From | Last Updated |
---|---|---|
I think you can completely ignore the HAL backend, afaik Alex wanted to drop it completely. |
|
|
Fix the comment to match the method name |
|
While you're at it, do you think it would be worthwhile to also add the other (new) properties, like temperature?
-
src/solid/backends/hal/halbattery.cpp (Diff revision 2) -
I think you can completely ignore the HAL backend, afaik Alex wanted to drop it completely.
-
src/solid/ifaces/battery.h (Diff revision 2) -
Fix the comment to match the method name
Review request changed
Change Summary:
Adds temperature property and fixes ex-plugged comment EnergyEmpty, EnergyFull and EnergyFullDesign are not added as the important ones Energy (current Wh), EnergyRate (draw W) and capacity (%) are there and sufficient imo. I found out what that mysterious "Luminosity" property is: it is reported by solar-powered Logitech keyboards [1] telling how much light is falling onto the solar cell, which doesn't seem very interesting for us right now but we can add it later if really needed (cool light meter in battery monitor anyone? ;) [1] More infos: http://julien.danjou.info/blog/2012/logitech-unifying-upower
Diff: |
Revision 3 (+537 -84) |
---|
Ping?
Looks good to me, wait until lukas replies though.
Ship It!
Review request changed
Change Summary:
Rebased Aleix' branch and split the battery stuff out.
Ship It!
This review has been submitted with commit bb2374e19505d5c6a72039a46d55ec3f632192f4 by Aleix Pol on behalf of Kai Uwe Broulik to branch master.