Skip to content

Commit

Permalink
add additional waits
Browse files Browse the repository at this point in the history
  • Loading branch information
aarron-lee committed Jan 21, 2024
1 parent 14e1999 commit 1817385
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions py_modules/devices/legion_go.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# https://github.com/corando98/

def ryzenadj(tdp):
logging.info('legion_go set tdp {tdp}')
try:
set_smart_fan_mode(0xff)
time.sleep(0.1)
Expand Down
2 changes: 1 addition & 1 deletion py_modules/devices/rog_ally.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def set_tdp_platform_profile(tdp):
result = execute_bash_command(command, PLATFORM_PROFILE_PATH)
if result.stderr:
decky_plugin.logger.error(f"{__name__} platform_profile error {result.stderr}")
sleep(1.0)
sleep(2.0)
return result


Expand Down
18 changes: 16 additions & 2 deletions src/redux-modules/steamPatchMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { resumeAction } from "./extraActions";
import { getSteamPerfSettings } from "../steamPatch/steamPatch";
import { getProfileForCurrentIdSelector } from "../steamPatch/utils";

let setTdpTimeoutId: any;

const saveToBackendTypes = [
cacheSteamPatchTdp.type,
cacheSteamPatchGpu.type,
Expand Down Expand Up @@ -52,7 +54,13 @@ export const steamPatchMiddleware =
if (action.type === resumeAction.type) {
if (steamPatchEnabled) {
if (steamPatchProfile?.tdp) {
setSteamPatchTDP(steamPatchProfile.tdp);
if (setTdpTimeoutId) {
clearTimeout(setTdpTimeoutId);
setTdpTimeoutId = undefined;
}
setTimeout(() => {
setSteamPatchTDP(steamPatchProfile.tdp);
}, 2000);
}
// getSteamPerfSettings();
}
Expand All @@ -61,7 +69,13 @@ export const steamPatchMiddleware =
if (action.type === setCurrentGameInfo.type) {
if (steamPatchEnabled) {
if (steamPatchProfile?.tdp) {
setSteamPatchTDP(steamPatchProfile.tdp);
if (setTdpTimeoutId) {
clearTimeout(setTdpTimeoutId);
setTdpTimeoutId = undefined;
}
setTimeout(() => {
setSteamPatchTDP(steamPatchProfile.tdp);
}, 2000);
}
// get steam perf settings when currentGameId changes
// getSteamPerfSettings();
Expand Down

0 comments on commit 1817385

Please sign in to comment.