Skip to content

Commit

Permalink
add migration for DEFAULT to BALANCE gpuMode
Browse files Browse the repository at this point in the history
  • Loading branch information
aarron-lee committed Sep 23, 2024
1 parent ddbc699 commit 2d05c00
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from plugin_settings import merge_tdp_profiles, get_saved_settings, get_tdp_profile, get_active_tdp_profile, per_game_profiles_enabled, set_setting as persist_setting
from gpu_utils import get_gpu_frequency_range
import plugin_utils
# import migrations
import migrations
import steam_info
import device_utils

Expand Down Expand Up @@ -235,3 +235,4 @@ async def _migration(self):

# migrations.migrate_smt()
# migrations.disable_steam_patch()
migrations.migrate_gpu_mode()
19 changes: 19 additions & 0 deletions py_modules/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,22 @@ def disable_steam_patch():
set_setting('advanced', advanced_settings)
except Exception as e:
decky_plugin.logger.error(f"{__name__} error while disabling steam patch {e}")

def migrate_gpu_mode():
try:
settings = get_saved_settings()
if not settings.get('tdpProfiles'):
settings['tdpProfiles'] = {}
tdp_profiles = settings.get('tdpProfiles')

for game_id in tdp_profiles:
profile = tdp_profiles[game_id]

mode = profile.get('gpuMode', None)

if mode == 'DEFAULT':
profile['gpuMode'] = 'BALANCE'

merge_tdp_profiles(tdp_profiles)
except Exception as e:
decky_plugin.logger.error(f"{__name__} error while setting default smt values {e}")

0 comments on commit 2d05c00

Please sign in to comment.