Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional controllers #105

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be generic to any xbox controller, or are there different versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I'm aware there is only one model of Xbox controller.

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