Skip to content

Commit

Permalink
add double-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
aarron-lee committed Dec 5, 2023
1 parent 296944a commit faeb867
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ async def save_controller_settings(self, controller, currentGameId):
settings.set_setting('controllerPerGameProfilesEnabled', controllerPerGameProfilesEnabled)
result = settings.set_all_controller_profiles(controllerProfiles)

# sync settings.json to actual controller hardware
if currentGameId:
controllers.sync_controller_profile_settings(currentGameId)
# sync touchpad
controllers.sync_touchpad(currentGameId)
# sync gyros
controllers.sync_gyros(currentGameId)
# double-sync just in case the first one doesn't register
for i in range(2):
# sync settings.json to actual controller hardware
if currentGameId:
controllers.sync_controller_profile_settings(currentGameId)
# sync touchpad
controllers.sync_touchpad(currentGameId)
# sync gyros
controllers.sync_gyros(currentGameId)
return result

async def save_rgb_settings(self, rgbProfiles, currentGameId):
Expand Down

0 comments on commit faeb867

Please sign in to comment.