diff --git a/telldus-gui/Plugins/Scheduler/DefaultJobTypes.js b/telldus-gui/Plugins/Scheduler/DefaultJobTypes.js index 25759d17..5f3c4b22 100644 --- a/telldus-gui/Plugins/Scheduler/DefaultJobTypes.js +++ b/telldus-gui/Plugins/Scheduler/DefaultJobTypes.js @@ -148,7 +148,7 @@ function loadJobs(){ //ID = ID for storage //Key is position in list, returned from "addJob" - var execFunc = function(){ print("Custom execute function running"); return 42; }; + var execFunc = function(job){ print("Custom execute function running"); print("Job: " + job.v.name); return 42; }; var newRecurringMonthJob = getJob({id: 4, executeFunc: execFunc, name: "testnamn14", type: com.telldus.scheduler.JOBTYPE_ABSOLUTE, startdate: startdate1, lastRun: 0, device: 1, method: 1, value: ""}); newRecurringMonthJob.addEvent(new Event({id: 0, value: "", fuzzinessBefore: 0, fuzzinessAfter: 0, type: com.telldus.scheduler.EVENTTYPE_ABSOLUTE, offset: 10, time: (new Date().getTime())/1000 + 20})); com.telldus.scheduler.addJob(newRecurringMonthJob); diff --git a/telldus-gui/Plugins/Scheduler/__init__.js b/telldus-gui/Plugins/Scheduler/__init__.js index 5c4357ff..e813cb7f 100644 --- a/telldus-gui/Plugins/Scheduler/__init__.js +++ b/telldus-gui/Plugins/Scheduler/__init__.js @@ -283,7 +283,7 @@ com.telldus.scheduler.Job.prototype.execute = function(){ //may be overridden if other than device manipulation should be performed var success = 0; if(this.v.executeFunc != null){ - success = this.v.executeFunc(); + success = this.v.executeFunc(this); this.updateJobLastRun(); return success; }