adjustor 2.1.3__tar.gz → 2.1.5__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {adjustor-2.1.3/src/adjustor.egg-info → adjustor-2.1.5}/PKG-INFO +1 -1
- {adjustor-2.1.3 → adjustor-2.1.5}/pyproject.toml +1 -1
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/core/lenovo.py +11 -1
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/drivers/asus/__init__.py +38 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/drivers/asus/settings.yml +29 -1
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/drivers/lenovo/__init__.py +9 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/drivers/lenovo/settings.yml +7 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/drivers/smu/smu.yml +0 -1
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/hhd.py +8 -7
- adjustor-2.1.5/src/adjustor/i18n.py +2 -0
- {adjustor-2.1.3 → adjustor-2.1.5/src/adjustor.egg-info}/PKG-INFO +1 -1
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor.egg-info/SOURCES.txt +1 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/LICENSE +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/MANIFEST.in +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/readme.md +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/setup.cfg +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/__init__.py +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/__main__.py +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/core/__init__.py +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/core/acpi.py +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/core/alib.py +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/core/const.py +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/core/platform.py +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/drivers/__init__.py +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/drivers/smu/__init__.py +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/drivers/smu/qam.yml +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/events.py +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/settings.yml +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor/utils.py +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor.egg-info/dependency_links.txt +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor.egg-info/entry_points.txt +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor.egg-info/requires.txt +0 -0
- {adjustor-2.1.3 → adjustor-2.1.5}/src/adjustor.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: adjustor
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.5
|
4
4
|
Summary: Adjustor, a userspace program for managing the TDP of handheld devices.
|
5
5
|
Author-email: Kapenekakis Antheas <pypi@antheas.dev>
|
6
6
|
Project-URL: Homepage, https://github.com/hhd-dev/adjustor
|
@@ -110,7 +110,7 @@ def set_power_light(enabled: bool):
|
|
110
110
|
|
111
111
|
|
112
112
|
def get_power_light():
|
113
|
-
logger.
|
113
|
+
logger.debug(f"Getting power light status.")
|
114
114
|
if not call(r"\_SB.GZFD.WMAF", [0, 0x01, 0x03], risky=False):
|
115
115
|
return None
|
116
116
|
o = read()
|
@@ -195,6 +195,16 @@ def get_slow_tdp():
|
|
195
195
|
return get_feature(0x0101FF00)
|
196
196
|
|
197
197
|
|
198
|
+
def get_charge_limit():
|
199
|
+
logger.debug(f"Retrieving charge limit.")
|
200
|
+
return get_feature(0x03010001)
|
201
|
+
|
202
|
+
|
203
|
+
def set_charge_limit(enable: bool):
|
204
|
+
logger.info(f"Setting charge limit (80 %) to {enable}.")
|
205
|
+
return set_feature(0x03010001, enable)
|
206
|
+
|
207
|
+
|
198
208
|
def set_steady_tdp(val: int):
|
199
209
|
logger.info(f"Setting steady TDP to {val}.")
|
200
210
|
return set_feature(0x0102FF00, val)
|
@@ -32,6 +32,20 @@ MIN_CURVE = [2, 5, 17, 17, 17, 17, 17, 17]
|
|
32
32
|
DEFAULT_CURVE = [5, 10, 20, 35, 55, 75, 75, 75]
|
33
33
|
|
34
34
|
|
35
|
+
def set_charge_limit(lim: int):
|
36
|
+
try:
|
37
|
+
# FIXME: Hardcoded path, should match using another characteristic
|
38
|
+
logger.info(f"Setting charge limit to {lim:d} %.")
|
39
|
+
with open(
|
40
|
+
"/sys/class/power_supply/BAT0/charge_control_end_threshold", "w"
|
41
|
+
) as f:
|
42
|
+
f.write(f"{lim}\n")
|
43
|
+
return True
|
44
|
+
except Exception as e:
|
45
|
+
logger.error(f"Failed to write battery limit with error:\n{e}")
|
46
|
+
return False
|
47
|
+
|
48
|
+
|
35
49
|
def set_tdp(pretty: str, fn: str, val: int):
|
36
50
|
logger.info(f"Setting tdp value '{pretty}' to {val} by writing to:\n{fn}")
|
37
51
|
try:
|
@@ -148,6 +162,30 @@ class AsusDriverPlugin(HHDPlugin):
|
|
148
162
|
|
149
163
|
curr = time.time()
|
150
164
|
|
165
|
+
# Charge limit
|
166
|
+
lim = conf["tdp.asus.charge_limit"].to(str)
|
167
|
+
if (self.startup and lim != "disabled") or (
|
168
|
+
lim != self.old_conf["charge_limit"].to(str)
|
169
|
+
):
|
170
|
+
match lim:
|
171
|
+
case "p65":
|
172
|
+
set_charge_limit(65)
|
173
|
+
case "p70":
|
174
|
+
set_charge_limit(70)
|
175
|
+
case "p80":
|
176
|
+
set_charge_limit(80)
|
177
|
+
case "p85":
|
178
|
+
set_charge_limit(85)
|
179
|
+
case "p90":
|
180
|
+
set_charge_limit(90)
|
181
|
+
case "p95":
|
182
|
+
set_charge_limit(95)
|
183
|
+
case "disabled":
|
184
|
+
# Avoid writing charge limit on startup if
|
185
|
+
# disabled
|
186
|
+
if not self.startup:
|
187
|
+
set_charge_limit(100)
|
188
|
+
|
151
189
|
#
|
152
190
|
# TDP
|
153
191
|
#
|
@@ -95,4 +95,32 @@ children:
|
|
95
95
|
type: display
|
96
96
|
default: >-
|
97
97
|
Asus hardware limits the minimum fan curve depending on TDP.
|
98
|
-
The minimums are 25%, 50%, and 75% for low,
|
98
|
+
The minimums are 25%, 50%, and 75% for low, medium, and high TDPs.
|
99
|
+
|
100
|
+
charge_limit:
|
101
|
+
type: multiple
|
102
|
+
title: Charge Limit (%)
|
103
|
+
tags: [ non-essential ]
|
104
|
+
hint: >-
|
105
|
+
Applies a charge limit to the battery, 75% and up.
|
106
|
+
options:
|
107
|
+
disabled: Disabled
|
108
|
+
p65: 65%
|
109
|
+
p70: 70%
|
110
|
+
p80: 80%
|
111
|
+
p85: 85%
|
112
|
+
p90: 90%
|
113
|
+
p95: 95%
|
114
|
+
default: disabled
|
115
|
+
|
116
|
+
disclaimer:
|
117
|
+
title: Sleep Bug
|
118
|
+
type: display
|
119
|
+
tags: [ non-essential ]
|
120
|
+
default: >-
|
121
|
+
There is an Asus kernel/BIOS bug that will sometimes limit TDP to 10W
|
122
|
+
after sleep.
|
123
|
+
As the kernel driver is used, this is unfixable from within
|
124
|
+
Handheld Daemon (currently investigated).
|
125
|
+
As an alternative, use SimpleDeckyTDP with RyzenAdj after
|
126
|
+
disabling TDP controls from "Settings".
|
@@ -8,9 +8,11 @@ from hhd.plugins.conf import Config
|
|
8
8
|
from adjustor.core.lenovo import (
|
9
9
|
MIN_CURVE,
|
10
10
|
TdpMode,
|
11
|
+
get_charge_limit,
|
11
12
|
get_full_fan_speed,
|
12
13
|
get_power_light,
|
13
14
|
get_tdp_mode,
|
15
|
+
set_charge_limit,
|
14
16
|
set_fan_curve,
|
15
17
|
set_fast_tdp,
|
16
18
|
set_full_fan_speed,
|
@@ -84,6 +86,7 @@ class LenovoDriverPlugin(HHDPlugin):
|
|
84
86
|
if self.startup:
|
85
87
|
conf["tdp.lenovo.ffss"] = get_full_fan_speed()
|
86
88
|
conf["tdp.lenovo.power_light"] = get_power_light()
|
89
|
+
conf["tdp.lenovo.charge_limit"] = get_charge_limit()
|
87
90
|
|
88
91
|
# If not old config, exit, as values can not be set
|
89
92
|
if not self.old_conf:
|
@@ -105,6 +108,12 @@ class LenovoDriverPlugin(HHDPlugin):
|
|
105
108
|
):
|
106
109
|
set_power_light(power_light)
|
107
110
|
|
111
|
+
charge_limit = conf["tdp.lenovo.charge_limit"].to(bool)
|
112
|
+
if charge_limit is not None and charge_limit != self.old_conf[
|
113
|
+
"charge_limit"
|
114
|
+
].to(bool):
|
115
|
+
set_charge_limit(charge_limit)
|
116
|
+
|
108
117
|
#
|
109
118
|
# TDP
|
110
119
|
#
|
@@ -134,6 +134,13 @@ children:
|
|
134
134
|
hint: >-
|
135
135
|
Reset to the original fan curve provided by Lenovo in BIOS V28.
|
136
136
|
|
137
|
+
charge_limit:
|
138
|
+
tags: [advanced]
|
139
|
+
type: bool
|
140
|
+
title: Enable Charge Limit (80%)
|
141
|
+
hint: >-
|
142
|
+
Limits device charging to 80%. Lenovo EC method. Available since BIOSv29.
|
143
|
+
|
137
144
|
power_light:
|
138
145
|
tags: [advanced]
|
139
146
|
type: bool
|
@@ -1,16 +1,18 @@
|
|
1
1
|
import logging
|
2
2
|
import os
|
3
|
-
from threading import Event as TEvent
|
3
|
+
from threading import Event as TEvent
|
4
|
+
from threading import Thread
|
4
5
|
from typing import Sequence
|
5
6
|
|
6
|
-
from hhd.utils import expanduser
|
7
7
|
from hhd.plugins import Context, HHDPlugin, HHDSettings, load_relative_yaml
|
8
8
|
from hhd.plugins.conf import Config
|
9
9
|
from hhd.plugins.plugin import Emitter
|
10
|
+
from hhd.utils import expanduser
|
10
11
|
|
11
12
|
from adjustor.core.acpi import check_perms, initialize
|
12
13
|
from adjustor.core.const import CPU_DATA, DEV_DATA, ROG_ALLY_PP_MAP
|
13
14
|
|
15
|
+
from .i18n import _
|
14
16
|
from .utils import exists_sentinel, install_sentinel, remove_sentinel
|
15
17
|
|
16
18
|
logger = logging.getLogger(__name__)
|
@@ -55,7 +57,7 @@ class AdjustorInitPlugin(HHDPlugin):
|
|
55
57
|
conf["hhd.settings.tdp_enable"] = False
|
56
58
|
if self.safe_mode:
|
57
59
|
logger.warning(f"Due to a sentinel error, auto-start is disabled.")
|
58
|
-
conf["tdp.tdp.tdp_error"] = (
|
60
|
+
conf["tdp.tdp.tdp_error"] = _(
|
59
61
|
"Due to a suspected crash, auto-start was disabled."
|
60
62
|
)
|
61
63
|
conf["hhd.settings.tdp_enable"] = False
|
@@ -68,9 +70,8 @@ class AdjustorInitPlugin(HHDPlugin):
|
|
68
70
|
|
69
71
|
for name, path in CONFLICTING_PLUGINS.items():
|
70
72
|
if os.path.exists(expanduser(path, self.context)):
|
71
|
-
err = (
|
72
|
-
|
73
|
-
+ "TDP Controls can not be enabled while other TDP plugins are installed."
|
73
|
+
err = f'Found plugin "{name}" at the following path:\n{path}\n' + _(
|
74
|
+
"TDP Controls can not be enabled while other TDP plugins are installed."
|
74
75
|
)
|
75
76
|
conf["tdp.tdp.tdp_error"] = err
|
76
77
|
conf["hhd.settings.tdp_enable"] = False
|
@@ -169,8 +170,8 @@ def autodetect(existing: Sequence[HHDPlugin]) -> Sequence[HHDPlugin]:
|
|
169
170
|
if len(existing):
|
170
171
|
return existing
|
171
172
|
|
172
|
-
from .drivers.lenovo import LenovoDriverPlugin
|
173
173
|
from .drivers.asus import AsusDriverPlugin
|
174
|
+
from .drivers.lenovo import LenovoDriverPlugin
|
174
175
|
from .drivers.smu import SmuDriverPlugin, SmuQamPlugin
|
175
176
|
|
176
177
|
drivers = []
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: adjustor
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.5
|
4
4
|
Summary: Adjustor, a userspace program for managing the TDP of handheld devices.
|
5
5
|
Author-email: Kapenekakis Antheas <pypi@antheas.dev>
|
6
6
|
Project-URL: Homepage, https://github.com/hhd-dev/adjustor
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|