Improve logging
This commit is contained in:
@@ -209,16 +209,23 @@ class Watch {
|
|||||||
initialAlertFunc = this.#watchObjects[watchUUID].initialAlertFunc;
|
initialAlertFunc = this.#watchObjects[watchUUID].initialAlertFunc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create timer to run initial alert rule
|
// Set alert state
|
||||||
this.#watchObjects[watchUUID].alert = true;
|
this.#watchObjects[watchUUID].alert = true;
|
||||||
this.#watchObjects[watchUUID].startAlertTimer = actions.ScriptExecution.createTimer('startAlert ' + watchUUID,
|
|
||||||
time.toZDT(this.#watchObjects[watchUUID].alertDelay),
|
|
||||||
() => {
|
|
||||||
console.log('Run initial alert function for watchObject ' + watchUUID);
|
|
||||||
initialAlertFunc();
|
|
||||||
}
|
|
||||||
|
|
||||||
);
|
// Execute initial alert function or create timer to run initial alert rule if required
|
||||||
|
if (this.#watchObjects[watchUUID].alertDelay == '') {
|
||||||
|
console.log('Run initial alert function for watchObject ' + watchUUID);
|
||||||
|
initialAlertFunc();
|
||||||
|
} else {
|
||||||
|
console.log('Run initial alert function for watchObject ' + watchUUID + ' with delay setting ' + this.#watchObjects[watchUUID].alertDelay);
|
||||||
|
this.#watchObjects[watchUUID].startAlertTimer = actions.ScriptExecution.createTimer('startAlert ' + watchUUID,
|
||||||
|
time.toZDT(this.#watchObjects[watchUUID].alertDelay),
|
||||||
|
() => {
|
||||||
|
console.log('Run initial alert function for watchObject ' + watchUUID);
|
||||||
|
initialAlertFunc();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Create timer to run repeat alert rule if required
|
// Create timer to run repeat alert rule if required
|
||||||
if (this.#watchObjects[watchUUID].alertRepeat != '') {
|
if (this.#watchObjects[watchUUID].alertRepeat != '') {
|
||||||
|
|||||||
Reference in New Issue
Block a user