Skip to content

Commit

Permalink
Add additional controllers (#105)
Browse files Browse the repository at this point in the history
* Add Xbox controller support
* Add PS5 controller support
  • Loading branch information
civerachb-cpr authored Jan 6, 2025
1 parent 55636b0 commit 12e21f3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion clearpath_config/platform/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ class PlatformConfig(BaseConfig):

# Controllers
PS4 = 'ps4'
PS5 = 'ps5'
LOGITECH = 'logitech'
XBOX = 'xbox'
CONTROLLERS = [
PS4,
PS5,
LOGITECH,
XBOX
]

CONTROLLER = 'controller'
ATTACHMENTS = 'attachments'
Expand Down Expand Up @@ -217,7 +225,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 12e21f3

Please sign in to comment.