Skip to content

Commit

Permalink
Add xbox controller support
Browse files Browse the repository at this point in the history
  • Loading branch information
civerachb-cpr committed Dec 17, 2024
1 parent 55636b0 commit a8330fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clearpath_config/platform/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ class PlatformConfig(BaseConfig):
# Controllers
PS4 = 'ps4'
LOGITECH = 'logitech'
XBOX = 'xbox'
CONTROLLERS = [
PS4,
LOGITECH,
XBOX
]

CONTROLLER = 'controller'
ATTACHMENTS = 'attachments'
Expand Down Expand Up @@ -217,7 +223,7 @@ def controller(self) -> str:

@controller.setter
def controller(self, value: str) -> None:
assert value.lower() in [self.PS4, self.LOGITECH], f'"{value.lower()}" controller is invalid. Must be one of "{[self.PS4, self.LOGITECH]}"' # noqa:501
assert value.lower() in self.CONTROLLERS, f'"{value.lower()}" controller is invalid. Must be one of "{self.CONTROLLERS}"' # noqa:501
self._controller = value.lower()

@property
Expand Down

0 comments on commit a8330fc

Please sign in to comment.