Switch to lib.compare
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user