<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def async_set_switch_state( self, switch_number: SwitchNumber, state: bool) -> None: """ Turn a switch on or off. :param switch_number: the switch to be set. :param state: True to turn on, False to turn off. """


        await self._protocol.async_execute(
            SetSwitchCommand(
                switch_number,
                SwitchState.On if state else SwitchState.Off))