The main thing I could think of would be to create a controller class.
The class would have variables that are associated with the controller (the joystick, button1, button2...). It could be a data class for readability
@dataclass
class Controller:
joystick_x:int
joystick_y:int
button1:bool
button2:bool
def update_controller():
pass
# update the controls here
In that class, you could put a update_controller method that would check the serial input to update the variables. I think that you could put that method at the beginning of the update method of your game class so you can update in consideration of your inputs.
class MyGame(arcade.Window)
def __init__():
controller = Controller()
def update():
controller.update_controller()
if controller.button1:
pass # do something
You would now have to add a control variable to the game class to make it easier to use the data of the controller class.