adjustor 3.6.0__tar.gz → 3.6.2__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. {adjustor-3.6.0/src/adjustor.egg-info → adjustor-3.6.2}/PKG-INFO +1 -1
  2. {adjustor-3.6.0 → adjustor-3.6.2}/pyproject.toml +1 -1
  3. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/core/const.py +1 -0
  4. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/core/fan/core.py +8 -5
  5. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/core/fan/utils.py +6 -3
  6. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/asus/__init__.py +22 -13
  7. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/general/__init__.py +8 -5
  8. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/settings.yml +1 -4
  9. {adjustor-3.6.0 → adjustor-3.6.2/src/adjustor.egg-info}/PKG-INFO +1 -1
  10. {adjustor-3.6.0 → adjustor-3.6.2}/LICENSE +0 -0
  11. {adjustor-3.6.0 → adjustor-3.6.2}/MANIFEST.in +0 -0
  12. {adjustor-3.6.0 → adjustor-3.6.2}/readme.md +0 -0
  13. {adjustor-3.6.0 → adjustor-3.6.2}/setup.cfg +0 -0
  14. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/__init__.py +0 -0
  15. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/__main__.py +0 -0
  16. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/core/__init__.py +0 -0
  17. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/core/acpi.py +0 -0
  18. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/core/alib.py +0 -0
  19. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/core/fan/__init__.py +0 -0
  20. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/core/fan/__main__.py +0 -0
  21. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/core/fan/alg.py +0 -0
  22. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/core/lenovo.py +0 -0
  23. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/core/platform.py +0 -0
  24. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/__init__.py +0 -0
  25. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/amd/__init__.py +0 -0
  26. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/amd/power-profiles-daemon.dbus.xml.in +0 -0
  27. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/amd/ppd.py +0 -0
  28. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/amd/settings.yml +0 -0
  29. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/asus/settings.yml +0 -0
  30. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/general/settings.yml +0 -0
  31. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/lenovo/__init__.py +0 -0
  32. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/lenovo/settings.yml +0 -0
  33. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/smu/__init__.py +0 -0
  34. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/smu/qam.yml +0 -0
  35. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/drivers/smu/smu.yml +0 -0
  36. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/events.py +0 -0
  37. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/fuse/__init__.py +0 -0
  38. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/fuse/driver.py +0 -0
  39. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/fuse/gpu.py +0 -0
  40. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/fuse/utils.py +0 -0
  41. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/hhd.py +0 -0
  42. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor/i18n.py +0 -0
  43. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor.egg-info/SOURCES.txt +0 -0
  44. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor.egg-info/dependency_links.txt +0 -0
  45. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor.egg-info/entry_points.txt +0 -0
  46. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor.egg-info/requires.txt +0 -0
  47. {adjustor-3.6.0 → adjustor-3.6.2}/src/adjustor.egg-info/top_level.txt +0 -0
  48. {adjustor-3.6.0 → adjustor-3.6.2}/usr/share/dbus-1/system.d/hhd-net.hadess.PowerProfiles.conf +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: adjustor
3
- Version: 3.6.0
3
+ Version: 3.6.2
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 = "3.6.0"
3
+ version = "3.6.2"
4
4
  authors = [
5
5
  { name="Kapenekakis Antheas", email="pypi@antheas.dev" },
6
6
  ]
@@ -120,4 +120,5 @@ CPU_DATA: dict[str, tuple[dict[str, DeviceParams], dict[str, AlibParams]]] = {
120
120
  "AMD Ryzen 7 8840U": (DEV_PARAMS_8040, ALIB_PARAMS_8040),
121
121
  # AMD Athlon Silver 3050e (Win600, will it support tdp?)
122
122
  "AMD Ryzen AI 9 HX 370": (DEV_PARAMS_HX370, ALIB_PARAMS_HX370),
123
+ "AMD Ryzen AI HX 360": (DEV_PARAMS_HX370, ALIB_PARAMS_HX370),
123
124
  }
@@ -99,9 +99,12 @@ def calculate_fan_speed(
99
99
 
100
100
 
101
101
  def set_fans_to_pwm(enable: bool, fan_info: FanInfo):
102
- for _, fn_enable, _ in fan_info["fans"]:
102
+ for _, fn_enable, _, legacy in fan_info["fans"]:
103
103
  with open(fn_enable, "w") as f:
104
- f.write("1" if enable else "0")
104
+ if enable:
105
+ f.write("1")
106
+ else:
107
+ f.write("0" if legacy else "2")
105
108
 
106
109
 
107
110
  def update_fan_speed(
@@ -121,10 +124,10 @@ def update_fan_speed(
121
124
  v_curr_int = min(255, max(0, int(v_curr * 255)))
122
125
  if not observe_only:
123
126
  if state is None or state["v_target_pwm"] != v_curr_int:
124
- for v_fn, _, _ in fan_info["fans"]:
127
+ for v_fn, _, _, _ in fan_info["fans"]:
125
128
  write_fan_speed(v_fn, v_curr_int)
126
129
 
127
- fan_speeds = [read_fan_speed(rpm_fn) for _, _, rpm_fn in fan_info["fans"] if rpm_fn]
130
+ fan_speeds = [read_fan_speed(rpm_fn) for _, _, rpm_fn, _ in fan_info["fans"] if rpm_fn]
128
131
  return (
129
132
  in_setpoint,
130
133
  {
@@ -153,7 +156,7 @@ def fan_worker(
153
156
  set_fans_to_pwm(True, info)
154
157
  while not should_exit.is_set():
155
158
  with lock:
156
- state_tmp = state or None # First time state will be empty
159
+ state_tmp = state or None # First time state will be empty
157
160
  in_setpoint, state_tmp = update_fan_speed(
158
161
  state_tmp, info, fan_curve, junction.is_set()
159
162
  )
@@ -1,6 +1,7 @@
1
1
  import os
2
2
 
3
- FAN_HWMONS = ["oxpec"]
3
+ FAN_HWMONS_LEGACY = ["oxpec"]
4
+ FAN_HWMONS = ["oxp_ec"]
4
5
  HWMON_DIR = "/sys/class/hwmon"
5
6
 
6
7
 
@@ -53,7 +54,7 @@ def find_fans():
53
54
  with open(f"{HWMON_DIR}/{hwmon}/name") as f:
54
55
  name = f.read().strip()
55
56
 
56
- if name not in FAN_HWMONS:
57
+ if name not in FAN_HWMONS and name not in FAN_HWMONS_LEGACY:
57
58
  continue
58
59
 
59
60
  for fn in os.listdir(f"{HWMON_DIR}/{hwmon}"):
@@ -73,6 +74,7 @@ def find_fans():
73
74
  f"{HWMON_DIR}/{hwmon}/{fn}",
74
75
  f"{HWMON_DIR}/{hwmon}/{fn}_enable",
75
76
  speed_fn,
77
+ name in FAN_HWMONS_LEGACY,
76
78
  )
77
79
  )
78
80
 
@@ -88,6 +90,7 @@ def read_fan_speed(path: str) -> int:
88
90
  with open(path, "r") as f:
89
91
  return int(f.read())
90
92
 
93
+
91
94
  def write_fan_speed(path: str, speed: int):
92
95
  with open(path, "w") as f:
93
- f.write(str(speed))
96
+ f.write(str(speed))
@@ -169,7 +169,9 @@ class AsusDriverPlugin(HHDPlugin):
169
169
  path_exists = os.path.exists(EXTREME_FN)
170
170
  extreme_supported = EXTREME_ENABLE and path_exists
171
171
  if self.extreme_supported is None:
172
- logger.info(f"Extreme standby enabled: {EXTREME_ENABLE}, file exists: {extreme_supported}. Enabled: {extreme_supported}")
172
+ logger.info(
173
+ f"Extreme standby enabled: {EXTREME_ENABLE}, file exists: {extreme_supported}. Enabled: {extreme_supported}"
174
+ )
173
175
  self.extreme_supported = extreme_supported
174
176
  if not self.extreme_supported:
175
177
  del out["tdp"]["asus"]["children"]["extreme_standby"]
@@ -177,21 +179,25 @@ class AsusDriverPlugin(HHDPlugin):
177
179
  # Set units
178
180
  if self.allyx:
179
181
  out["tdp"]["asus"]["children"]["tdp_v2"]["modes"]["quiet"]["unit"] = "13W"
180
- out["tdp"]["asus"]["children"]["tdp_v2"]["modes"]["balanced"]["unit"] = "17W"
182
+ out["tdp"]["asus"]["children"]["tdp_v2"]["modes"]["balanced"][
183
+ "unit"
184
+ ] = "17W"
181
185
  out["tdp"]["asus"]["children"]["tdp_v2"]["modes"]["performance"][
182
186
  "unit"
183
187
  ] = "25/30W"
184
188
  else:
185
189
  out["tdp"]["asus"]["children"]["tdp_v2"]["modes"]["quiet"]["unit"] = "10W"
186
- out["tdp"]["asus"]["children"]["tdp_v2"]["modes"]["balanced"]["unit"] = "15W"
190
+ out["tdp"]["asus"]["children"]["tdp_v2"]["modes"]["balanced"][
191
+ "unit"
192
+ ] = "15W"
187
193
  out["tdp"]["asus"]["children"]["tdp_v2"]["modes"]["performance"][
188
194
  "unit"
189
195
  ] = "25/30W"
190
196
 
191
197
  if not self.enforce_limits:
192
- out["tdp"]["asus"]["children"]["tdp_v2"]["modes"]["custom"]["children"]["tdp"][
193
- "max"
194
- ] = 50
198
+ out["tdp"]["asus"]["children"]["tdp_v2"]["modes"]["custom"]["children"][
199
+ "tdp"
200
+ ]["max"] = 50
195
201
  return out
196
202
 
197
203
  def open(
@@ -298,6 +304,7 @@ class AsusDriverPlugin(HHDPlugin):
298
304
  new_target = "performance"
299
305
 
300
306
  # In custom mode, re-apply settings with debounce
307
+ tdp_set = False
301
308
  if mode == "custom":
302
309
  # Check user changed values
303
310
  if new_tdp:
@@ -410,7 +417,7 @@ class AsusDriverPlugin(HHDPlugin):
410
417
 
411
418
  # Check if fan curve has changed
412
419
  # Use debounce logic on these changes
413
- if tdp_reset and manual_fan_curve:
420
+ if ((tdp_reset and mode != "custom") or tdp_set) and manual_fan_curve:
414
421
  self.queue_fan = curr + APPLY_DELAY
415
422
 
416
423
  for i in POINTS:
@@ -431,7 +438,7 @@ class AsusDriverPlugin(HHDPlugin):
431
438
  self.queue_tdp = curr + APPLY_DELAY
432
439
 
433
440
  apply_curve = self.queue_fan and self.queue_fan < curr
434
- if apply_curve:
441
+ if apply_curve or tdp_set:
435
442
  try:
436
443
  if conf["tdp.asus.fan.mode"].to(str) == "manual":
437
444
  set_fan_curve(
@@ -475,7 +482,7 @@ class AsusDriverPlugin(HHDPlugin):
475
482
  with open(EXTREME_FN, "r") as f:
476
483
  cval = f.read().strip() == "1"
477
484
  if nval != cval:
478
- logger.info (f"Setting extreme standby to '{standby}'")
485
+ logger.info(f"Setting extreme standby to '{standby}'")
479
486
  with open(EXTREME_FN, "w") as f:
480
487
  f.write("1" if standby == "enabled" else "0")
481
488
  else:
@@ -487,7 +494,7 @@ class AsusDriverPlugin(HHDPlugin):
487
494
  for ev in events:
488
495
  if ev["type"] == "tdp":
489
496
  self.new_tdp = ev["tdp"]
490
- self.sys_tdp = ev['tdp'] is not None
497
+ self.sys_tdp = ev["tdp"] is not None
491
498
  elif ev["type"] == "ppd":
492
499
  match ev["status"]:
493
500
  case "power":
@@ -496,10 +503,12 @@ class AsusDriverPlugin(HHDPlugin):
496
503
  self.new_mode = "balanced"
497
504
  case "performance":
498
505
  self.new_mode = "performance"
499
- elif ev['type'] == 'special' and ev.get('event', None) == "wakeup":
500
- logger.info(f"Waking up from sleep, resetting TDP after {SLEEP_DELAY} seconds.")
506
+ elif ev["type"] == "special" and ev.get("event", None) == "wakeup":
507
+ logger.info(
508
+ f"Waking up from sleep, resetting TDP after {SLEEP_DELAY} seconds."
509
+ )
501
510
  self.queue_tdp = time.time() + SLEEP_DELAY
502
- elif self.cycle_tdp and ev['type'] == "special" and ev['event'] == "xbox_y":
511
+ elif self.cycle_tdp and ev["type"] == "special" and ev["event"] == "xbox_y":
503
512
  match self.mode:
504
513
  case "quiet":
505
514
  self.new_mode = "balanced"
@@ -32,6 +32,7 @@ class GeneralPowerPlugin(HHDPlugin):
32
32
  self.ovr_enabled = False
33
33
  self.should_exit = Event()
34
34
  self.t_sys = None
35
+ self.currentTarget = None
35
36
 
36
37
  def settings(self):
37
38
  sets = load_relative_yaml("./settings.yml")
@@ -151,10 +152,11 @@ class GeneralPowerPlugin(HHDPlugin):
151
152
  "balanced": "balanced",
152
153
  "performance": "throughput-performance"
153
154
  }
155
+
154
156
  new_profile = ppd_tuned_mapping.get(conf.get("tdp.general.profile", self.target))
155
- if new_profile != self.target and new_profile and self.target:
156
- logger.info(f"Setting TuneD profile to '{new_profile}'")
157
- self.target = new_profile
157
+ if new_profile != self.currentTarget and new_profile and self.currentTarget:
158
+ logger.info(f"Setting TuneD profile to '{new_profile}' from '{self.target}'")
159
+ self.currentTarget = new_profile
158
160
  try:
159
161
  subprocess.run(
160
162
  [shutil.which('tuned-adm'), "profile", new_profile],
@@ -162,6 +164,7 @@ class GeneralPowerPlugin(HHDPlugin):
162
164
  stdout=subprocess.PIPE,
163
165
  stderr=subprocess.PIPE,
164
166
  )
167
+
165
168
  except Exception as e:
166
169
  self.tuned_supported = False
167
170
  logger.warning(f"tuned-adm returned with error:\n{e}")
@@ -176,13 +179,13 @@ class GeneralPowerPlugin(HHDPlugin):
176
179
  stdout=subprocess.PIPE,
177
180
  stderr=subprocess.PIPE,
178
181
  )
179
-
180
182
  tuned_ppd_mapping = {
181
183
  "powersave": "power-saver",
182
184
  "balanced": "balanced",
183
185
  "throughput-performance": "performance"
184
186
  }
185
- self.target = tuned_ppd_mapping.get(res.stdout.decode().split(":")[1].strip()) # type: ignore
187
+ self.currentTarget = res.stdout.decode().split(":")[1].strip()
188
+ self.target = tuned_ppd_mapping.get(self.currentTarget) # type: ignore
186
189
 
187
190
  if self.target != conf["tdp.general.profile"].to(str):
188
191
  conf["tdp.general.profile"] = self.target
@@ -25,10 +25,7 @@ tdp:
25
25
  tags: [ non-essential ]
26
26
  default: >
27
27
  Handheld Daemon supports the TDP slider in Steam and can use its per
28
- game profiles now. For the Legion Go and Ally, it also supports custom
29
- fan curves and battery limits.
30
- Consider it, unless you prefer Decky.
31
- (Powercontrol supports fan curves for GPD and Ayaneo devices)
28
+ game profiles. It also supports custom fan curves and battery limits.
32
29
 
33
30
  decky_remove:
34
31
  title: Disable Decky TDP Plugins
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: adjustor
3
- Version: 3.6.0
3
+ Version: 3.6.2
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