dbus: org.freedesktop.UPower.Device: Add SetChargeStrategy method

SetChargeStrategy method sets the battery charge algorithm to an given
value if the system supports the setting.
This commit is contained in:
Kate Hsuan 2026-01-22 12:22:00 +08:00
parent adeaa5d886
commit 3620f425ec

View file

@ -243,6 +243,95 @@ method return sender=:1.386 -> dest=:1.477 reply_serial=2
</doc:doc>
</method>
<!-- ************************************************************ -->
<method name="SetChargeStrategy">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="strategies" direction="in" type="s">
<doc:doc><doc:summary>
Set the charging strategy for the battery device.
<doc:list>
<doc:item>
<doc:term>Unknown</doc:term>
<doc:definition>
The battery charging behavior is unknown or not supported.
</doc:definition>
</doc:item>
</doc:list>
<doc:list>
<doc:item>
<doc:term>N/A</doc:term>
<doc:definition>
The battery charging behavior is not supported
</doc:definition>
</doc:item>
</doc:list>
<doc:list>
<doc:item>
<doc:term>Trickle</doc:term>
<doc:definition>
The battery charges slowly.
</doc:definition>
</doc:item>
</doc:list>
<doc:list>
<doc:item>
<doc:term>Fast</doc:term>
<doc:definition>
Quickly charge the battery using fast-charge technology
</doc:definition>
</doc:item>
</doc:list>
<doc:list>
<doc:item>
<doc:term>Standard</doc:term>
<doc:definition>
Fully charge the battery with a moderate rate.
</doc:definition>
</doc:item>
</doc:list>
<doc:list>
<doc:item>
<doc:term>Adaptive</doc:term>
<doc:definition>
The battery charges at a rate that adapts to the battery's capacity which the system firmware controls.
</doc:definition>
</doc:item>
</doc:list>
<doc:list>
<doc:item>
<doc:term>Custom</doc:term>
<doc:definition>
The battery charges at a rate that is set by the user.
</doc:definition>
</doc:item>
</doc:list>
<doc:list>
<doc:item>
<doc:term>Long Life</doc:term>
<doc:definition>
The charger reduces its charging rate in order to prolong the battery health.
</doc:definition>
</doc:item>
</doc:list>
<doc:list>
<doc:item>
<doc:term>Bypass</doc:term>
<doc:definition>
Bypass the charge path around the integrated charger. A external charger is used instead to manage the charging
</doc:definition>
</doc:item>
</doc:list>
</doc:summary></doc:doc>
</arg>
<doc:doc>
<doc:description>
<doc:para>
Set the charging strategy against the supported charge strategies. The supported charging strategies can be found by invoking the GetSupportedChargeStrategies method.
</doc:para>
</doc:description>
</doc:doc>
</method>
<!-- ************************************************************ -->
<method name="GetHistory">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>