Commit graph

30 commits

Author SHA1 Message Date
Sicelo A. Mhlongo
f6e63cfc40 upower: deprecate luminosity property
Since d2053eff ("linux: Remove user-space support for Logitech Unifying
devices"), the luminosity property is no longer in use and no code for it
exists except in the lib. Deprecate and eventually drop it.
2025-12-17 16:46:28 +08:00
Kate Hsuan
0f57b6bf73 Drop the incorrect "since version" and mark the capacity_level property as deprecated
Fix: 09ada72 (dbus: org.freedesktop.UPower.Device: deprecate CapacityLevel property)
2025-12-17 16:19:55 +08:00
Kate Hsuan
09ada726f7 dbus: org.freedesktop.UPower.Device: deprecate CapacityLevel property
This property is duplicated from BatteryLevel and confuses the user.
2025-11-25 14:33:55 +08:00
Kate Hsuan
d316a111f7 dbus: org.freedesktop.UPower: Enumerate kbd backlight LEDs
Enumerate all keyboard backlight LED objects on the system.
2025-09-05 17:22:08 +08:00
Kate Hsuan
0dcb46475f dbus: org.freedesktop.UPower.KbdBacklight: Description for deprecating the KbdBacklight object path
The object path /org/freedesktop/UPower/KbdBacklight is going to be deprecated in the future.
The upper-layer app should migrate to the new API instead.
2025-09-05 11:49:38 +08:00
Kate Hsuan
40a4498454 dbus: KbdBacklight: Add a native path attribute
The DBus property shows the udev native path.
2025-09-05 11:49:38 +08:00
Kate Hsuan
1c7b9d8bae dbus: org.freedesktop.UPower.Device: the ChargeThresholdSettingsSupported property
The types of settings for charge thresholds that are supported. The value
is a bitmask value and it is the sum of the supported types.

1: The system supports charge start threshold. The battery discharges to a
   percentage, then starts charging.
2: The system supports charge end threshold. The battery charges to a
   percentage, then stops charging.
4: The system supports optimized charging behaviors controlled by the
   system firmware.

Examples:

If the system supports charge start threshold and charge end threshold,
the value is 3.

If the system supports charge end threshold and the battery charging
behavior is controlled by the system firmware, the value is 6.
2025-08-11 15:05:10 +08:00
Sicelo A. Mhlongo
9ee3a36a6e dbus: Define CapacityLevel, VoltageMinDesign and VoltageMaxDesign properties
Some drivers provide capacity_level, voltage_min_design, and voltage_max_design
properties on sysfs even for system supplies. Expose these properties over DBus
for consumption by clients.

Related: #301

Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
2025-04-16 14:38:56 +08:00
Sicelo A. Mhlongo
a16c752e85 dbus: UPower.xml: Update GetCriticalAction Values
UPower now supports Suspend and Ignore as possible actions. Update the
documentation accordingly.
2025-02-06 10:46:33 +02:00
Kate Hsuan
bab81e5e44 Fix spelling issues with codespell 2025-01-08 14:01:34 +08:00
Kate Hsuan
9449cb5831 dbus: G_MAXUINT means ignore ChargeStartThreshold or ChargeEndThreshold
If the value is G_MAXUINT, it means charge_control_start_threshold or
charge_control_end_threshold will be skipped.
2024-08-23 22:21:52 +08:00
Jelle van der Waa
dc28eccd1c dbus: Define EnableChargeLimit() dbus method
EnableChargeLimit() is used to enable/disable the battery charging threshold
feature.

Signed-off-by: Kate Hsuan <hpa@redhat.com>
2024-08-20 16:58:42 +08:00
Jelle van der Waa
3df2599629 dbus: Define ChargeThresholdEnabled and ChargeThresholdSupported properties
ChargeThresholdSupported property is used to show if the battery supports
Charging threshold feature. ChargeThresholdEnabled is used to show the
configuration (enabled/disabled) status of the feature.

Signed-off-by: Kate Hsuan <hpa@redhat.com>
2024-08-02 13:58:48 +08:00
Jelle van der Waa
a12f7d7eef dbus: Define ChargeStartThreshold and ChargeEndThreshold properties
Define dbus interface for ChargeStartThreshold and ChargeEndThreshold.

Signed-off-by: Kate Hsuan <hpa@redhat.com>
2024-08-02 13:58:48 +08:00
Kenny Levinsen
d8c22cf085 docs: Document all current device types
We only had documentation for the first 9 device types, ending with
Phone. Document all the current 29 device types.
2024-03-05 22:36:39 +01:00
Jelle van der Waa
17c14cc63f Revert "all: Remove Lid handling"
This reverts commit 07565ef6a1.

In the current systemd stable release 255 org.freedesktop.login1 does
not emit a LidisClosed event, this has added in systemd `main` and will
be availble in the next release.

As GNOME control panel still uses UPower's `LidIsclosed` property and
many other DE's such as Xfce/LXQt/Deepin as well revert this until the
systemd changes are available in all Distributions.

https://github.com/systemd/systemd/pull/30706

Resolve: https://gitlab.freedesktop.org/upower/upower/-/issues/260
2024-01-26 14:57:27 +00:00
Kate Hsuan
b21cec4c11 dbus: org.freedesktop.UPower: EnergyRate is a positive value
The EnergyRate is a positive value since most of the laptops are ACPI
based system and report the power status through power_now sysfs
attribute. Moreover, the ACPI specification mention that the battery
power status is a positive value, measured in watt.

https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/acpi-battery-and-power-subsystem-firmware-implementation

Fix: https://gitlab.freedesktop.org/upower/upower/-/issues/252

Signed-off-by: Kate Hsuan <hpa@redhat.com>
2024-01-15 07:36:53 +00:00
Bastien Nocera
07565ef6a1 all: Remove Lid handling
It is now handled solely in logind to take power management decisions,
and in the compositor for making decisions related to available
displays.

See:
https://www.freedesktop.org/software/systemd/man/org.freedesktop.login1.html
2023-07-06 11:09:42 +02:00
Bastien Nocera
d0ebbe32bb device: Only handle Refresh() method if in debug mode
The Refresh D-Bus method could be used by clients to force re-reading
the state of batteries in the upower backends. This is not needed as
all the backends should be sending events when their states changes,
removing the need for an explicit refresh.

This is also a potential security problem if applications keep on
refreshing their data.

We now only allow access to the Refresh() method if the daemon was
started in debugging mode. This should make it clearer that it is a
debug tool.

Also remove a mention of the never implemented refresh-power-source
polkit authorisation.
2022-04-19 15:27:36 +02:00
Benjamin Berg
9058d45685 Remove Wakeups API
The API relied on /proc/timer_stats which has been removed from the
kernel in 2017. Since then, the API has been non-functional (yet
incorrectly reporting support because the support test was buggy).

Just remove it completely. The debian codesearch does not uncover any
API users. Also, I doubt that any new API (based on tracing scheduler
events as perf would do) would map well to what exists now. i.e. if
something like this is re-implemented in UPower or elsewhere, then the
API should likely look different.

And, realistically, if this does need root privileges (i.e. can't be
moved to use BPF programs or so on user units), then we can also create
a new small daemon that is launched on-demand just for that.
2022-03-24 17:02:27 +01:00
Bastien Nocera
1e53985dfa dbus: Add ChargeCycles property 2021-09-13 12:51:16 +02:00
Bastien Nocera
9b93b6c402 build: Remove autotools 2021-09-06 14:06:40 +02:00
Benjamin Berg
02ab49963b meson: Fix header/source extraction from gdbus_codegen
Otherwise we depend on the C sources being ready rather than the headers
for building the rest of upowerd.
2021-09-06 14:06:40 +02:00
Benjamin Berg
f2e702d4dc build: Support building upower with meson 2021-09-02 17:47:30 +02:00
Bastien Nocera
c7104a19b3 docs: Mention that not all batteries are laptop batteries
They might be device batteries where the device type is not known or
catalogued.
2019-05-07 11:44:22 +00:00
Bastien Nocera
0980b2dd40 docs: Mention to try and not use IconName when possible
See https://gitlab.freedesktop.org/upower/upower/merge_requests/16#note_41003
2018-10-02 10:48:07 +02:00
Bastien Nocera
b9aaa05bc6 docs: Better documentation for the BatteryLevel prop
https://bugs.freedesktop.org/show_bug.cgi?id=103361
2017-10-31 17:45:18 +01:00
Bastien Nocera
499d05b837 all: Add BatteryLevel property
Export approximate battery levels that devices can use, exported by
the kernel as POWER_SUPPLY_CAPACITY_LEVEL_* values.

This avoids bizarrely accurate values showing up in UIs when we only
have ok/warning levels of accuracy in some cases.

https://bugs.freedesktop.org/show_bug.cgi?id=100359
2017-04-06 16:33:38 +02:00
Hans de Goede
112814fd4f UpKbdBacklight: Add new BrightnessChangedWithSource signal
There are multiple possible causes for the keyboard brightness to change,
e.g. SetBrightness may get called, or the brightness may get changed
through a hotkey which is handled in firmware.

https://bugs.freedesktop.org/show_bug.cgi?id=98404
2017-02-15 17:33:16 +01:00
Cosimo Cecchi
c108a8e8a4 Share generated code between daemon and library
Since we use the same GDBus code in libupower-glib and the daemon,
auto-generate a private library that can be used by both.
2015-07-29 13:38:13 +01:00