def _switch_on(self, code):
    if (self.on_off_commands == None):
        raise Exception('No On/Off command set')
    self._handle_action(self.on_off_commands['ON'](code))
def _switch_on(self, code):
    if (self.on_off_commands == None):
        raise Exception('No On/Off command set')
    self._handle_action(self.on_off_commands['ON'](code))