1
0

Switch to lib.compare

This commit is contained in:
2023-08-14 19:45:17 +02:00
parent 5ee804c69a
commit 4b238fc065

View File

@@ -110,7 +110,7 @@ class Watch {
let currentState = lib.convertValue(this.#item.state); let currentState = lib.convertValue(this.#item.state);
// Do comparison // Do comparison
if (this.#compare(currentState, this.#watchObjects[watchUUID].targetState, this.#watchObjects[watchUUID].operator)) { // Comparison successful if (lib.compare(currentState, this.#watchObjects[watchUUID].targetState, this.#watchObjects[watchUUID].operator)) { // Comparison successful
console.log('State ' + currentState + ' is ' + this.#watchObjects[watchUUID].operator + ' ' + this.#watchObjects[watchUUID].targetState + ' triggered by ' + watchUUID); console.log('State ' + currentState + ' is ' + this.#watchObjects[watchUUID].operator + ' ' + this.#watchObjects[watchUUID].targetState + ' triggered by ' + watchUUID);
if (this.#watchObjects[watchUUID].alert == true) { // Comparison successful and alert is already active if (this.#watchObjects[watchUUID].alert == true) { // Comparison successful and alert is already active
this.#rescheduleAlert(watchUUID); this.#rescheduleAlert(watchUUID);