adjustor 3.4.6__tar.gz → 3.5.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. {adjustor-3.4.6/src/adjustor.egg-info → adjustor-3.5.0}/PKG-INFO +1 -1
  2. {adjustor-3.4.6 → adjustor-3.5.0}/pyproject.toml +1 -1
  3. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/asus/__init__.py +56 -15
  4. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/asus/settings.yml +14 -1
  5. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/hhd.py +1 -0
  6. {adjustor-3.4.6 → adjustor-3.5.0/src/adjustor.egg-info}/PKG-INFO +1 -1
  7. {adjustor-3.4.6 → adjustor-3.5.0}/LICENSE +0 -0
  8. {adjustor-3.4.6 → adjustor-3.5.0}/MANIFEST.in +0 -0
  9. {adjustor-3.4.6 → adjustor-3.5.0}/readme.md +0 -0
  10. {adjustor-3.4.6 → adjustor-3.5.0}/setup.cfg +0 -0
  11. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/__init__.py +0 -0
  12. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/__main__.py +0 -0
  13. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/core/__init__.py +0 -0
  14. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/core/acpi.py +0 -0
  15. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/core/alib.py +0 -0
  16. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/core/const.py +0 -0
  17. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/core/lenovo.py +0 -0
  18. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/core/platform.py +0 -0
  19. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/__init__.py +0 -0
  20. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/amd/__init__.py +0 -0
  21. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/amd/power-profiles-daemon.dbus.xml.in +0 -0
  22. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/amd/ppd.py +0 -0
  23. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/amd/settings.yml +0 -0
  24. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/general/__init__.py +0 -0
  25. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/general/settings.yml +0 -0
  26. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/lenovo/__init__.py +0 -0
  27. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/lenovo/settings.yml +0 -0
  28. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/smu/__init__.py +0 -0
  29. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/smu/qam.yml +0 -0
  30. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/drivers/smu/smu.yml +0 -0
  31. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/events.py +0 -0
  32. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/fuse/__init__.py +0 -0
  33. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/fuse/driver.py +0 -0
  34. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/fuse/gpu.py +0 -0
  35. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/fuse/utils.py +0 -0
  36. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/i18n.py +0 -0
  37. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor/settings.yml +0 -0
  38. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor.egg-info/SOURCES.txt +0 -0
  39. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor.egg-info/dependency_links.txt +0 -0
  40. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor.egg-info/entry_points.txt +0 -0
  41. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor.egg-info/requires.txt +0 -0
  42. {adjustor-3.4.6 → adjustor-3.5.0}/src/adjustor.egg-info/top_level.txt +0 -0
  43. {adjustor-3.4.6 → adjustor-3.5.0}/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.4.6
3
+ Version: 3.5.0
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.4.6"
3
+ version = "3.5.0"
4
4
  authors = [
5
5
  { name="Kapenekakis Antheas", email="pypi@antheas.dev" },
6
6
  ]
@@ -13,14 +13,18 @@ logger = logging.getLogger(__name__)
13
13
  APPLY_DELAY = 0.7
14
14
  TDP_DELAY = 0.1
15
15
  SLEEP_DELAY = 4
16
- MIN_TDP_START = 7
17
- MAX_TDP_START = 30
16
+ MIN_TDP = 7
17
+ MAX_TDP = 30
18
18
  # FIXME: add AC/DC values
19
- MAX_TDP = 35
19
+ MAX_TDP_BOOST = 35
20
20
 
21
21
  FTDP_FN = "/sys/devices/platform/asus-nb-wmi/ppt_fppt"
22
22
  STDP_FN = "/sys/devices/platform/asus-nb-wmi/ppt_pl2_sppt"
23
23
  CTDP_FN = "/sys/devices/platform/asus-nb-wmi/ppt_pl1_spl"
24
+ EXTREME_FN = "/sys/devices/platform/asus-nb-wmi/mcu_powersave"
25
+ EXTREME_ENABLE = bool(os.environ.get("HHD_ALLY_POWERSAVE", None))
26
+ # This setting can really mess up the controller
27
+ EXTREME_DELAY = 3.8
24
28
 
25
29
  FAN_CURVE_ENDPOINT = "/sys/class/hwmon"
26
30
  FAN_CURVE_NAME = "asus_custom_fan_curve"
@@ -137,9 +141,13 @@ class AsusDriverPlugin(HHDPlugin):
137
141
  self.mode = None
138
142
  self.cycle_tdp = None
139
143
 
144
+ self.extreme_standby = None
145
+ self.extreme_supported = None
146
+
140
147
  self.queue_fan = None
141
148
  self.queue_tdp = None
142
149
  self.queue_charge_limit = None
150
+ self.queue_extreme = None
143
151
  self.new_tdp = None
144
152
  self.new_mode = None
145
153
  self.old_target = None
@@ -157,6 +165,14 @@ class AsusDriverPlugin(HHDPlugin):
157
165
  self.initialized = True
158
166
  out = {"tdp": {"asus": load_relative_yaml("settings.yml")}}
159
167
 
168
+ path_exists = os.path.exists(EXTREME_FN)
169
+ extreme_supported = EXTREME_ENABLE and path_exists
170
+ if self.extreme_supported is None:
171
+ logger.info(f"Extreme standby enabled: {EXTREME_ENABLE}, file exists: {extreme_supported}. Enabled: {extreme_supported}")
172
+ self.extreme_supported = extreme_supported
173
+ if not self.extreme_supported:
174
+ del out["tdp"]["asus"]["children"]["extreme_standby"]
175
+
160
176
  # Set units
161
177
  if self.allyx:
162
178
  out["tdp"]["asus"]["children"]["tdp_v2"]["modes"]["quiet"]["unit"] = "13W"
@@ -242,14 +258,15 @@ class AsusDriverPlugin(HHDPlugin):
242
258
  if new_tdp:
243
259
  # For TDP values received from steam, set the appropriate
244
260
  # mode to get a better experience.
245
- if new_tdp == (13 if ally_x else 10):
246
- mode = "quiet"
247
- elif new_tdp == (17 if ally_x else 15):
248
- mode = "balanced"
249
- elif new_tdp == 25 or new_tdp == 30:
250
- mode = "performance"
251
- else:
252
- mode = "custom"
261
+ # if new_tdp == (13 if ally_x else 10):
262
+ # mode = "quiet"
263
+ # elif new_tdp == (17 if ally_x else 15):
264
+ # mode = "balanced"
265
+ # elif new_tdp == 25 or new_tdp == 30:
266
+ # mode = "performance"
267
+ # else:
268
+ # mode = "custom"
269
+ mode = "custom"
253
270
  conf["tdp.asus.tdp_v2.mode"] = mode
254
271
  elif new_mode:
255
272
  mode = new_mode
@@ -286,6 +303,14 @@ class AsusDriverPlugin(HHDPlugin):
286
303
  else:
287
304
  steady = conf["tdp.asus.tdp_v2.custom.tdp"].to(int)
288
305
 
306
+ if self.enforce_limits:
307
+ if steady < MIN_TDP:
308
+ steady = MIN_TDP
309
+ conf["tdp.asus.tdp_v2.custom.tdp"] = steady
310
+ elif steady > MAX_TDP:
311
+ steady = MAX_TDP
312
+ conf["tdp.asus.tdp_v2.custom.tdp"] = steady
313
+
289
314
  steady_updated = steady and steady != self.old_conf["tdp_v2.custom.tdp"].to(
290
315
  int
291
316
  )
@@ -294,11 +319,11 @@ class AsusDriverPlugin(HHDPlugin):
294
319
 
295
320
  steady_updated |= tdp_reset
296
321
 
297
- if self.startup and (steady > MAX_TDP_START or steady < MIN_TDP_START):
322
+ if self.startup and (steady > MAX_TDP or steady < MIN_TDP):
298
323
  logger.warning(
299
324
  f"TDP ({steady}) outside the device spec. Resetting for stability reasons."
300
325
  )
301
- steady = min(max(steady, MIN_TDP_START), MAX_TDP_START)
326
+ steady = min(max(steady, MIN_TDP), MAX_TDP)
302
327
  conf["tdp.asus.tdp_v2.custom.tdp"] = steady
303
328
  steady_updated = True
304
329
 
@@ -331,13 +356,13 @@ class AsusDriverPlugin(HHDPlugin):
331
356
  set_tdp(
332
357
  "fast",
333
358
  FTDP_FN,
334
- min(max(steady, MAX_TDP), int(steady * 35 / 25)),
359
+ min(max(steady, MAX_TDP_BOOST), int(steady * 35 / 25)),
335
360
  )
336
361
  time.sleep(TDP_DELAY)
337
362
  set_tdp(
338
363
  "slow",
339
364
  STDP_FN,
340
- min(max(steady, MAX_TDP), int(steady * 30 / 25)),
365
+ min(max(steady, MAX_TDP_BOOST), int(steady * 30 / 25)),
341
366
  )
342
367
  time.sleep(TDP_DELAY)
343
368
  set_tdp("steady", CTDP_FN, steady)
@@ -433,6 +458,22 @@ class AsusDriverPlugin(HHDPlugin):
433
458
  if self.startup:
434
459
  self.startup = False
435
460
 
461
+ # Extreme standby
462
+ if self.extreme_supported:
463
+ standby = conf["tdp.asus.extreme_standby"].to(bool)
464
+ if standby != self.extreme_standby:
465
+ self.extreme_standby = standby
466
+ self.queue_extreme = curr + EXTREME_DELAY
467
+
468
+ if self.queue_extreme and self.queue_extreme < curr:
469
+ self.queue_extreme = None
470
+ try:
471
+ logger.info (f"Setting extreme standby to '{standby}'")
472
+ with open(EXTREME_FN, "w") as f:
473
+ f.write("1" if standby == "enabled" else "0")
474
+ except Exception as e:
475
+ logger.error(f"Could not set extreme standby. Error:\n{e}")
476
+
436
477
  def notify(self, events: Sequence[Event]):
437
478
  for ev in events:
438
479
  if ev["type"] == "tdp":
@@ -142,4 +142,17 @@ children:
142
142
  p90: 90%
143
143
  p95: 95%
144
144
  disabled: Unset
145
- default: disabled
145
+ default: disabled
146
+
147
+ extreme_standby:
148
+ type: multiple
149
+ title: Extreme Standby Mode
150
+ tags: [ non-essential, ordinal ]
151
+ options:
152
+ disabled: Disabled
153
+ enabled: Enabled
154
+ default: disabled
155
+ hint: >-
156
+ Lowers the power consumption of the device from 4% to 1% overnight.
157
+ Active only on battery. Turns off the power light and the controller
158
+ requires longer to wake up.
@@ -269,6 +269,7 @@ def autodetect(existing: Sequence[HHDPlugin]) -> Sequence[HHDPlugin]:
269
269
  ):
270
270
  drivers.append(AsusDriverPlugin("RC72L" in prod))
271
271
  drivers_matched = True
272
+ min_tdp = 7
272
273
 
273
274
  if os.environ.get("HHD_ADJ_DEBUG") or os.environ.get("HHD_ENABLE_SMU"):
274
275
  drivers_matched = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: adjustor
3
- Version: 3.4.6
3
+ Version: 3.5.0
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