<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on(self, state):
 """ Turn on or off. :param state: True (on) or False (off). """

        self._on = state
        cmd = self.command_set.off()
        if state:
            cmd = self.command_set.on()
        self.send(cmd)