def _control(self, state):
<EOL>if not self._subscription_is_recent():<EOL><INDENT>self._subscribe()<EOL><DEDENT>cmd = MAGIC + CONTROL + self._mac + PADDING_1 + PADDING_2 + state<EOL>_LOGGER.debug("<STR_LIT>", self.host, ord(state))<EOL>ack_state = self._udp_transact(cmd, self._control_resp, state)<EOL>if ack_state is None:<EOL><INDENT>raise S20Exception(<EOL>"<STR_LIT>".format(<EOL>self.host))<EOL><DEDENT>
Control device state.

        Possible states are ON or OFF.

        :param state: Switch to this state.