Skip to content
Snippets Groups Projects
Commit b2eb6d61 authored by Strasser, Andreas's avatar Strasser, Andreas
Browse files

fixed remote command execution

parent b51e1e06
No related branches found
No related tags found
No related merge requests found
...@@ -72,24 +72,30 @@ end ...@@ -72,24 +72,30 @@ end
def _execute_commands() def _execute_commands()
while _configuration_commands.size() > 0 while _configuration_commands.size() > 0
for device_mac : _configuration_commands['macs'] var configuration_command = _configuration_commands[0]
var own_command = nil var device_macs = configuration_command['macs']
var command = configuration_command['command']
for device_mac : device_macs
if device_mac == otaconf.get_mac() if device_mac == otaconf.get_mac()
_own_command = command['command'] _own_command = command
else else
tasmota.log('OTA: remotely executing command on device: ' + device_mac, 2) tasmota.log('OTA: remotely executing command on device: ' + device_mac, 2)
var payload = {'action': 'EXECUTE_COMMAND', 'command': command['command']} var payload = {'action': 'EXECUTE_COMMAND', 'command': command}
mesh.send(otaconf.format_mac(device_mac), json.dump(payload)) mesh.send(otaconf.format_mac(device_mac), json.dump(payload))
end end
end end
_configuration_commands.remove(0)
end end
_update_config_status() _update_config_status()
end end
def _distribute_files() def _distribute_files()
tasmota.log('OTA: distributing files', 2)
_execute_commands() _execute_commands()
end end
...@@ -143,7 +149,7 @@ def _process_config(response) ...@@ -143,7 +149,7 @@ def _process_config(response)
end end
end end
if _configuration.contains('mesh_scan') && response['configuration']['mesh_scan'] if response['configuration'].contains('mesh_scan') && response['configuration']['mesh_scan']
_scan_mesh() _scan_mesh()
else else
_distribute_files() _distribute_files()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment