def apply_action(self, cmd_name, *args): """Apply Action to Device.""" from tahoma_api import Action action = Action(self.tahoma_device.url) action.add_command(cmd_name, *args) self.controller.apply_actions("HomeAssistant", [action])
def execute(label, command): data = { "commands": [ { "name": command, } ] } for deviceURL, value in devices.items(): if label == value.label: print(deviceURL, value.label, value.command_definitions) data['deviceURL'] = deviceURL api.apply_actions(label, [Action(data)]) return jsonify(success=True, message='Device '+label+' found', commad=command) return jsonify(success=False, message='No device found')
def apply_action(controller, cmd_name, dev_url, *args): """Apply Action to Device.""" action = Action(dev_url) action.add_command(cmd_name, *args) controller.apply_actions('Test', [action])
def apply_action(self, cmd_name, *args): """Apply Action to Device.""" action = Action(self.tahoma_device.url) action.add_command(cmd_name, *args) self.controller.apply_actions("OpenPeerPower", [action])