async def _on_input(self, command, seat):
    'Switch input functionality\n\n        Calls on and off depending on command state\n        :param command: Command from game engine\n        :type command: dict\n        :param seat: Robot seat\n        :type seat: int\n        '
    if ('state' not in command):
        logging.warning('Switch: invalid command received')
        return
    try:
        val = str(command['state'])
    except (ValueError, TypeError):
        logging.warn(f"Switch: could not convert {command['state']} into String")
        return
    if ((val != 'up') and (val != 'down')):
        logging.warn('Switch: command not <up|down>')
        return
    if (val == 'up'):
        (await self.off(seat))
    else:
        (await self.on(seat))
Switch input functionality

Calls on and off depending on command state
:param command: Command from game engine
:type command: dict
:param seat: Robot seat
:type seat: int
async def _on_input(self, command, seat):
    'Switch input functionality\n\n        Calls on and off depending on command state\n        :param command: Command from game engine\n        :type command: dict\n        :param seat: Robot seat\n        :type seat: int\n        '
    if ('state' not in command):
        logging.warning('Switch: invalid command received')
        return
    try:
        val = str(command['state'])
    except (ValueError, TypeError):
        logging.warn(f"Switch: could not convert {command['state']} into String")
        return
    if ((val != 'up') and (val != 'down')):
        logging.warn('Switch: command not <up|down>')
        return
    if (val == 'up'):
        (await self.off(seat))
    else:
        (await self.on(seat))