From a8330fc18c2e01d07f457b29a9afa47259c9640c Mon Sep 17 00:00:00 2001 From: Chris Iverach-Brereton Date: Tue, 17 Dec 2024 12:47:39 -0500 Subject: [PATCH 1/2] Add xbox controller support --- clearpath_config/platform/platform.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clearpath_config/platform/platform.py b/clearpath_config/platform/platform.py index 074a33e..e613dfd 100644 --- a/clearpath_config/platform/platform.py +++ b/clearpath_config/platform/platform.py @@ -88,6 +88,12 @@ class PlatformConfig(BaseConfig): # Controllers PS4 = 'ps4' LOGITECH = 'logitech' + XBOX = 'xbox' + CONTROLLERS = [ + PS4, + LOGITECH, + XBOX + ] CONTROLLER = 'controller' ATTACHMENTS = 'attachments' @@ -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 From 7ab458540256d91cf720a0b9dd91b0942b187a16 Mon Sep 17 00:00:00 2001 From: Chris Iverach-Brereton Date: Thu, 19 Dec 2024 15:37:00 -0500 Subject: [PATCH 2/2] Add PS5 as another controller --- clearpath_config/platform/platform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clearpath_config/platform/platform.py b/clearpath_config/platform/platform.py index e613dfd..1024a6f 100644 --- a/clearpath_config/platform/platform.py +++ b/clearpath_config/platform/platform.py @@ -87,10 +87,12 @@ class PlatformConfig(BaseConfig): # Controllers PS4 = 'ps4' + PS5 = 'ps5' LOGITECH = 'logitech' XBOX = 'xbox' CONTROLLERS = [ PS4, + PS5, LOGITECH, XBOX ]