Skip to content

Commit

Permalink
update gpd autodetection
Browse files Browse the repository at this point in the history
  • Loading branch information
antheas committed Apr 15, 2024
1 parent 79d8414 commit 44d2012
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/hhd/device/gpd/win/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
GPD_CONFS = {
"G1618-04": {"name": "GPD Win 4", "hrtimer": True},
"G1617-01": {"name": "GPD Win Mini", "touchpad": True},
# TODO: GPD Win Max has multiple product names, switch to partial match
"G1619-04": {
"name": "GPD Win Max 2 2023 (04)",
"hrtimer": True,
Expand Down Expand Up @@ -144,12 +143,12 @@ def autodetect(existing: Sequence[HHDPlugin]) -> Sequence[HHDPlugin]:
if dconf:
return [GpdWinControllersPlugin(dmi, dconf)]

# Perform dmi agnostic detection
GPD_WIN_VID = 0x2F24
GPD_WIN_PID = 0x0135
try:
if len(enumerate_unique(GPD_WIN_VID, GPD_WIN_PID)):
with open("/sys/devices/virtual/dmi/id/sys_vendor") as f:
vendor = f.read().strip().lower()
if vendor == "gpd":
return [GpdWinControllersPlugin(dmi, get_default_config(dmi))]
except Exception:
pass

return []

0 comments on commit 44d2012

Please sign in to comment.