summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ci: Update for removed LidIsClosed propertywip/hadess/remove-lid-is-closedBastien Nocera2021-08-171-1/+1
|
* all: Remove Lid handlingBastien Nocera2021-08-1712-722/+2
| | | | | | It is now handled solely in logind to take power management decisions, and in the compositor for making decisions related to available displays.
* 0.99.13UPOWER_0_99_13Bastien Nocera2021-08-172-1/+15
|
* tests: Run test suite in verbose mode by defaultBastien Nocera2021-08-171-1/+1
| | | | So we can see progress better.
* tests: Export test log on failureBastien Nocera2021-08-171-0/+4
|
* tests: Test inhibitor lock for critical actionDylan Van Assche2021-08-172-5/+59
| | | | | | | | | | Inhibitor lock should be taken between the critical action notification and the execution of the critical action. Requires python-dbusmock > 0.23.1, test is skipped on lower versions. python-dbusmock in the CI is installed from git and bumped version to 0.23.2 until a new release is available.
* up-daemon: prevent suspending for critical actionDylan Van Assche2021-08-171-0/+13
| | | | | | Take inhibitor lock when notifying the user about a critical battery level and release lock when executing critical battery action.
* up-backend: add inhibitor lock interfaceDylan Van Assche2021-08-174-43/+70
| | | | | | | | Phones are suspended most of the time so they are not awake for > 20s to allow UPower to take action when battery is critical. Add an interface to take and release inhibitor locks which prevent the device from suspending to allow UPower to execute the critical power action.
* build: Require new gudev to fix battery detectionBastien Nocera2021-08-101-1/+1
| | | | | | | | | | gudev 234 had bugs converting cached sysfs properties to boolean which caused upower to think that batteries were not there, as the "present" sysfs attribute was misread. Require at least gudev 235 to avoid battery detection being broken. Closes: #149
* linux: Add test for touchpads being tagged as miceBastien Nocera2021-08-101-2/+2
| | | | udev adds both tags to touchpads, so replicate that behaviour.
* linux: Fix touchpad not being the right typeBastien Nocera2021-08-101-3/+3
| | | | | Touchpads are also tagged as mice, so make sure that we check for the touchpad property before checking for mouse one.
* linux: Don't throw away large but possible energy ratesBastien Nocera2021-08-101-2/+2
| | | | | | | | | USB PD 3.1 allows up to 240W (48V, 5A) and some proprietary supplies already delivered more than 100W over USB-C (USB PD 3.0 limit). Closes: #147 Reported by StefanBruens
* etc: Tweak default percentage levelsBastien Nocera2021-07-222-6/+6
| | | | | | | | | | | | | If we want the computer to be able to take useful action about the low battery, we should have a slightly higher "low" percentage level so that power saving made really makes a difference in runtime. Also bump "critical" slightly so that doom isn't quite as near but in the distance nonetheless. The "action" level stays the same, as 1% is too close to some batteries' actual switch off point, eg. the computer might brown out before we see 1%.
* device: Don't update properties when device isn't exportedPablo Correa Gómez2021-06-301-8/+4
| | | | | | | The code in up_device_notify() will still eventually be reached when the up_device_coldplug() implementations are called, and properties are set for the device type for the first time (rather than during instance construction).
* tests: Add test for non-default low levelPablo Correa Gómez2021-06-301-0/+36
|
* daemon: Sync icon and warning for non-default low levelPablo Correa Gómez2021-06-303-5/+13
| | | | | | | | | | | | | Before, the low level for changing the battery icon was hardcoded. However, as the `low_percentage` property is settable by the user using `PercentageLow` option. That can lead to inconsistencies when PercentageLow is not the default. For example, if PercentageLow is set higher than 10, the Low Battery level warning will be sent at the user-set level, but the battery icon would not be updated to "caution" until the percentage drops below 10%. This issue is solved in this commit by using the `low_percentage` property for the comparison instead of hardcoding the default.
* daemon: Make get_device_charge_icon() publicPablo Correa Gómez2021-06-183-37/+40
|
* tests: Add a test case for batteries with zero power drawPhilipp Zabel2021-06-171-0/+22
| | | | | | | Make sure that the issue reported in #7 and #44 is fixed. The mocked battery has a zero power_now attribute and a non-zero legacy current_now attribute on purpose, to detect if upowerd tries to read current_now if the power_now value is small.
* linux: Fix < 0.01 W energy-rate readings from power_now sysfs propertyPhilipp Zabel2021-06-171-2/+3
| | | | | | | | | | | | | | | | | Currently, if a power supplies' power_now sysfs file reports discharge rates < 0.01 W, the code will try to calculate the discharge rate from the legacy sysfs files. On new kernels where those don't exist, this produces wrong results. For example, on a dual-battery Thinkpad T450s, while the external battery is discharging, the internal battery reports power_now = 0, but the corresponding upower energy-rate field incorrectly reads about 2.3 W. This patch fixes the issue by falling back to the legacy code only if the legacy current_now sysfs file exists. Closes: #7, #44
* 0.99.12UPOWER_0_99_12Bastien Nocera2021-06-171-0/+16
|
* build: Force enable introspection for "make distcheck" to workBastien Nocera2021-06-171-1/+2
| | | | | Introspection support is needed to be able to instatiate a UPClient object in the test suite.
* ci: Export the tarball in the artifactsBastien Nocera2021-06-171-1/+10
| | | | Saves us from generating it locally.
* data: Also remove HID++ udev rulesBastien Nocera2021-06-172-11/+1
| | | | Now that HID++ user-space support has been removed.
* ci: Ignore changes to "kind" enumsBastien Nocera2021-06-172-1/+4
|
* linux: Make unknown Bluetooth devices appear as genericBastien Nocera2021-06-172-6/+7
| | | | | | | | | | Make Bluetooth devices for which we can't guess the "kind" or form factor be "generic Bluetooth" devices, rather than "unknown" devices. That should make it clearer in UIs that the devices are Bluetooth rather than connected to the computer somehow. Closes: #137
* lib: Add UP_DEVICE_KIND_BLUETOOTH_GENERIC typeBastien Nocera2021-06-172-0/+5
| | | | | | This will be useful to show information about Bluetooth devices which don't fit in with the existing types, and for which we don't want to show an unknown kind.
* linux: Remove user-space support for Logitech Unifying devicesBastien Nocera2021-06-177-1716/+2
| | | | | All those devices have been supported in the Linux kernel for a number of years already, so the user-space support has just not been exercised.
* linux: Remove sysfs-utils helpersBastien Nocera2021-06-178-201/+0
| | | | They've been replaced by gudev functions.
* linux: Use new uncached sysfs attr gudev APIBastien Nocera2021-06-172-67/+70
|
* linux: Use existing gudev functions in Watts-Up driverBastien Nocera2021-06-171-3/+5
|
* linux: Fix typo in test commentBastien Nocera2021-06-171-1/+1
|
* linux: Simplify is_macbook() functionBastien Nocera2021-06-171-9/+6
|
* linux: Ignore "capacity" sysfs on MacsBastien Nocera2021-06-172-0/+29
| | | | | | | | | | | capacity is supposed to be the running battery percentage, not a representation of its current state of the factory capacity (which isn't something that's ever shown in Linux or macOS). Use the new "ignore-system-percentage" property to work-around that problem. Closes: #141, #103
* linux: Move functionsBastien Nocera2021-06-171-22/+22
| | | | No functional changes.
* linux: Add property to ignore the "capacity" sysfs valueBastien Nocera2021-06-171-1/+50
| | | | | | | | On some hardware, the "capacity" sysfs contains the capacity of the battery when full compared to when it was new, instead of the percentage of battery available. Make it possible to ignore the "capacity" with this new property.
* ci: Add ABI checkBastien Nocera2021-04-221-0/+4
|
* ci: Indent the dependenciesBastien Nocera2021-04-221-6/+22
| | | | Makes it easier to make changes easily readable.
* up-tool: Catch NULL return for more upower API callsBenjamin Berg2021-02-041-0/+8
| | | | | | This can lead to crashes if the communication with the daemon fails. See https://bugzilla.redhat.com/show_bug.cgi?id=1922777
* up-client: Document and handle NULL return when getting devicesBenjamin Berg2021-02-041-3/+4
|
* tests: Add test cases for Bluetooth device classesMarijn Suijten2021-02-021-1/+109
|
* tests: Move BlueZ battery setup into helper functionMarijn Suijten2021-02-021-42/+27
|
* tests: Convert unpacked tuple constants to range()Marijn Suijten2021-02-021-3/+3
|
* linux: Parse kind from Class if Appearance is not availableMarijn Suijten2021-02-021-0/+94
| | | | | Not all headsets have a GAP profile revealing their appearance, but they do have a class.
* lib: Add more device kinds for Bluetooth classesMarijn Suijten2021-02-022-0/+65
| | | | | | | | | | | This adds a variety of missing device kinds specific to the Bluetooth classes supported in gnome-bluetooth [1]. In up_device_to_text these types have only been added to the `percentage` class, which is currently the only property exposed by org.bluez.Battery1, where these devices are coming from. [1]: https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/blob/cf4a0ba59dc092f84030349d9933caf00f2640a2/lib/bluetooth-utils.c#L165
* lib: Invert percentage conditional in device_to_textMarijn Suijten2021-02-021-11/+2
| | | | | | | Almost every device kind except line power and invalid (>= last) carry a valid percentage property. By inverting this conditional not every new device needs to be added explicitly to this already long and lacking chain (PDA and MONITOR were already missing).
* build: Remove libusb dependency in Linuxwip/hadess/remove-csrBastien Nocera2021-01-193-4/+0
| | | | As the last user, the CSR support code, was removed.
* linux: Remove support for CSR devicesBastien Nocera2021-01-196-432/+0
| | | | | | | Those devices date back from the mid-2000s. If they still work, and somebody is still interested in having them export their battery status, we would recommend moving this information to the appropriate kernel drivers.
* linux: Set update-time for BlueZ devicesBastien Nocera2021-01-182-1/+6
| | | | | When the battery percentage for a BlueZ device changes, change the update-time so that the charge history is somewhat useful.
* lib: Add "Touchpad" device typeBastien Nocera2020-12-168-12/+28
|
* linux: Fix gudev includes for UpInputBastien Nocera2020-11-052-1/+1
|