Hello,
It seems that the variables doesn't set correctly with the executeFile() Method.
For example
function startAutomation() {
// load global varible _scripts_configs
debugPrint("Starting JS Automation engine");
_scripts_configs = null;
executeFile(configFile);
loadAndInitModules();
_scripts_configs = null;
}
_scripts_configs is empty at the point where loadAndInitModules() gets called.
Is this a problem on my site?
executeFile() does not work correctly on main.js (automation)
I don't know what is in your
I don't know what is in your configFile variable (it should be the name to the JS file). Please check it.
I did not modified anything.
I did not modified anything. The files are "out of the box".
var configFile = automationRoot + "config.js";
and the config.js contains
_scripts_configs = [{
name: 'AutoOff',
module: 'AutoOff.js',
config: {
tags: 'AutoOff5sec',
delay: 5
}
}, { and so on....
If I initialize the object directly in the main.js file (by just copying the content) everything works fine until the point where "function loadModule(moduleName) {" wants to execute the external .js file defined in the object. This also doesn't work.
How does executeFile() works? Because it isn't so straightforward in javascript to include oder load other javascript files.
var configFile = automationRoot + "config.js";
and the config.js contains
_scripts_configs = [{
name: 'AutoOff',
module: 'AutoOff.js',
config: {
tags: 'AutoOff5sec',
delay: 5
}
}, { and so on....
If I initialize the object directly in the main.js file (by just copying the content) everything works fine until the point where "function loadModule(moduleName) {" wants to execute the external .js file defined in the object. This also doesn't work.
How does executeFile() works? Because it isn't so straightforward in javascript to include oder load other javascript files.