adjustor 2.1.1__tar.gz → 2.1.3__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. {adjustor-2.1.1/src/adjustor.egg-info → adjustor-2.1.3}/PKG-INFO +1 -1
  2. {adjustor-2.1.1 → adjustor-2.1.3}/pyproject.toml +1 -1
  3. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/drivers/asus/__init__.py +1 -1
  4. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/drivers/lenovo/__init__.py +17 -7
  5. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/hhd.py +17 -11
  6. {adjustor-2.1.1 → adjustor-2.1.3/src/adjustor.egg-info}/PKG-INFO +1 -1
  7. {adjustor-2.1.1 → adjustor-2.1.3}/LICENSE +0 -0
  8. {adjustor-2.1.1 → adjustor-2.1.3}/MANIFEST.in +0 -0
  9. {adjustor-2.1.1 → adjustor-2.1.3}/readme.md +0 -0
  10. {adjustor-2.1.1 → adjustor-2.1.3}/setup.cfg +0 -0
  11. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/__init__.py +0 -0
  12. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/__main__.py +0 -0
  13. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/core/__init__.py +0 -0
  14. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/core/acpi.py +0 -0
  15. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/core/alib.py +0 -0
  16. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/core/const.py +0 -0
  17. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/core/lenovo.py +0 -0
  18. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/core/platform.py +0 -0
  19. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/drivers/__init__.py +0 -0
  20. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/drivers/asus/settings.yml +0 -0
  21. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/drivers/lenovo/settings.yml +0 -0
  22. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/drivers/smu/__init__.py +0 -0
  23. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/drivers/smu/qam.yml +0 -0
  24. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/drivers/smu/smu.yml +0 -0
  25. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/events.py +0 -0
  26. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/settings.yml +0 -0
  27. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor/utils.py +0 -0
  28. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor.egg-info/SOURCES.txt +0 -0
  29. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor.egg-info/dependency_links.txt +0 -0
  30. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor.egg-info/entry_points.txt +0 -0
  31. {adjustor-2.1.1 → adjustor-2.1.3}/src/adjustor.egg-info/requires.txt +0 -0
  32. {adjustor-2.1.1 → adjustor-2.1.3}/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.1
3
+ Version: 2.1.3
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "adjustor"
3
- version = "2.1.1"
3
+ version = "2.1.3"
4
4
  authors = [
5
5
  { name="Kapenekakis Antheas", email="pypi@antheas.dev" },
6
6
  ]
@@ -98,7 +98,7 @@ def disable_fan_curve():
98
98
 
99
99
  class AsusDriverPlugin(HHDPlugin):
100
100
  def __init__(self) -> None:
101
- self.name = f"asus"
101
+ self.name = f"adjustor_asus"
102
102
  self.priority = 6
103
103
  self.log = "adja"
104
104
  self.enabled = False
@@ -8,11 +8,8 @@ from hhd.plugins.conf import Config
8
8
  from adjustor.core.lenovo import (
9
9
  MIN_CURVE,
10
10
  TdpMode,
11
- get_fan_curve,
12
- get_fast_tdp,
13
11
  get_full_fan_speed,
14
12
  get_power_light,
15
- get_steady_tdp,
16
13
  get_tdp_mode,
17
14
  set_fan_curve,
18
15
  set_fast_tdp,
@@ -141,6 +138,14 @@ class LenovoDriverPlugin(HHDPlugin):
141
138
  # Check user changed values
142
139
  steady = conf["tdp.lenovo.tdp.custom.tdp"].to(int)
143
140
 
141
+ old_steady = steady
142
+ if self.enforce_limits:
143
+ steady = min(max(steady, 4), 30)
144
+ else:
145
+ steady = min(max(steady, 0), 50)
146
+ if old_steady != steady:
147
+ conf["tdp.lenovo.tdp.custom.tdp"] = steady
148
+
144
149
  steady_updated = steady and steady != self.old_conf["tdp.custom.tdp"].to(
145
150
  int
146
151
  )
@@ -189,10 +194,15 @@ class LenovoDriverPlugin(HHDPlugin):
189
194
  conf[f"tdp.lenovo.fan.manual.st{(i + 1)*10}"] = v
190
195
 
191
196
  # Handle fan curve limits
192
- if conf["tdp.lenovo.fan.manual.enforce_limits"].to(bool):
193
- for i, v in enumerate(MIN_CURVE):
194
- if conf[f"tdp.lenovo.fan.manual.st{(i + 1)*10}"].to(int) < v:
195
- conf[f"tdp.lenovo.fan.manual.st{(i + 1)*10}"] = v
197
+ for i, v in enumerate(MIN_CURVE):
198
+ val = conf[f"tdp.lenovo.fan.manual.st{(i + 1)*10}"].to(int)
199
+ old_val = val
200
+ if conf["tdp.lenovo.fan.manual.enforce_limits"].to(bool) and val < v:
201
+ val = v
202
+
203
+ val = max(min(val, 115), 0)
204
+ if old_val != val:
205
+ conf[f"tdp.lenovo.fan.manual.st{(i + 1)*10}"] = val
196
206
 
197
207
  # Check if fan curve has changed
198
208
  # Use debounce logic on these changes
@@ -22,7 +22,7 @@ CONFLICTING_PLUGINS = {
22
22
 
23
23
 
24
24
  class AdjustorInitPlugin(HHDPlugin):
25
- def __init__(self) -> None:
25
+ def __init__(self, use_acpi_call: bool = True) -> None:
26
26
  self.name = f"adjustor_init"
27
27
  self.priority = 5
28
28
  self.log = "adji"
@@ -31,6 +31,7 @@ class AdjustorInitPlugin(HHDPlugin):
31
31
  self.safe_mode = False
32
32
  self.enabled = False
33
33
  self.action_enabled = False
34
+ self.use_acpi_call = use_acpi_call
34
35
 
35
36
  def open(self, emit: Emitter, context: Context):
36
37
  self.context = context
@@ -78,15 +79,16 @@ class AdjustorInitPlugin(HHDPlugin):
78
79
  self.enabled = False
79
80
  return
80
81
 
81
- initialize()
82
- if not check_perms():
83
- conf["hhd.settings.tdp_enable"] = False
84
- conf["tdp.tdp.tdp_error"] = (
85
- "Can not write to 'acpi_call'. It is required for TDP."
86
- )
87
- self.failed = True
88
- self.enabled = False
89
- return
82
+ if self.use_acpi_call:
83
+ initialize()
84
+ if not check_perms():
85
+ conf["hhd.settings.tdp_enable"] = False
86
+ conf["tdp.tdp.tdp_error"] = (
87
+ "Can not write to 'acpi_call'. It is required for TDP."
88
+ )
89
+ self.failed = True
90
+ self.enabled = False
91
+ return
90
92
 
91
93
  self.failed = False
92
94
  self.enabled = True
@@ -177,10 +179,12 @@ def autodetect(existing: Sequence[HHDPlugin]) -> Sequence[HHDPlugin]:
177
179
  with open("/proc/cpuinfo") as f:
178
180
  cpuinfo = f.read().strip()
179
181
 
182
+ use_acpi_call = False
180
183
  drivers_matched = False
181
184
  if prod == "83E1":
182
185
  drivers.append(LenovoDriverPlugin())
183
186
  drivers_matched = True
187
+ use_acpi_call = True
184
188
 
185
189
  if "ROG Ally RC71L" in prod:
186
190
  drivers.append(AsusDriverPlugin())
@@ -205,6 +209,7 @@ def autodetect(existing: Sequence[HHDPlugin]) -> Sequence[HHDPlugin]:
205
209
  ),
206
210
  )
207
211
  drivers_matched = True
212
+ use_acpi_call = True
208
213
 
209
214
  if not drivers_matched:
210
215
  for name, (dev, cpu) in CPU_DATA.items():
@@ -219,6 +224,7 @@ def autodetect(existing: Sequence[HHDPlugin]) -> Sequence[HHDPlugin]:
219
224
  drivers.append(
220
225
  SmuQamPlugin(dev, ROG_ALLY_PP_MAP),
221
226
  )
227
+ use_acpi_call = True
222
228
  break
223
229
 
224
230
  if not drivers:
@@ -227,6 +233,6 @@ def autodetect(existing: Sequence[HHDPlugin]) -> Sequence[HHDPlugin]:
227
233
 
228
234
  return [
229
235
  *drivers,
230
- AdjustorInitPlugin(),
236
+ AdjustorInitPlugin(use_acpi_call=use_acpi_call),
231
237
  AdjustorPlugin(),
232
238
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: adjustor
3
- Version: 2.1.1
3
+ Version: 2.1.3
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