Skip to content

feat: JSON data-structure mapping for device presets (#90)#92

Closed
turfin-logic wants to merge 1 commit into
HorizonUnix:mainfrom
turfin-logic:feat/preset-data-mapping-v0.7.01
Closed

feat: JSON data-structure mapping for device presets (#90)#92
turfin-logic wants to merge 1 commit into
HorizonUnix:mainfrom
turfin-logic:feat/preset-data-mapping-v0.7.01

Conversation

@turfin-logic
Copy link
Copy Markdown
Contributor

As discussed in #90, this PR introduces a JSON-based data-structure mapping framework to decouple hardware variant detection from the core Python scripts.

Changes

  1. Created Assets/device_presets.json which maps manufacturer, product names, and discrete GPUs to preset configuration arguments.
  2. Refactored hardware.py to use a new device_presets_loader.py to match variants dynamically.
  3. Updated presets.py to load preset args dynamically from JSON instead of a hardcoded switch case.

This framework allows users to easily add new hardware presets simply by editing a JSON file. Please let me know if any further tweaks are needed!

@oxGorou
Copy link
Copy Markdown
Member

oxGorou commented May 31, 2026

Hey @turfin-logic , thanks for changing things some things are really better now.

That being said there's still a problem with the order. The RX7700S rule needs to come before the 7040 rule in the list or it quietly picks the wrong setting. There's nothing in the format that tells you this so the next person who adds a Framework model will probably get it wrong...

Another thing that changed was moving the Eco, Balance, Performance and Extreme strings into the JSON. I wasn't expecting that. I think it makes things worse. If a key is missing or has a typo the code just passes a string to ryzenadj and nothing happens. No error, no warning, just the wrong behavior. At least when it was, in Python a missing case was obvious...

I still think using a match statement with a nested if for the GPU check is a way to do things. Closing this for now.

@oxGorou oxGorou closed this May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants