Turn a switch on or off.

        :param switch_number: the switch to be set.
        :param state: True to turn on, False to turn off.

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))