Commit graph

21 commits

Author SHA1 Message Date
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