Switch to lib.convertValue
This commit is contained in:
@@ -37,7 +37,7 @@ class Watch {
|
|||||||
// Create watch object and return UUID
|
// Create watch object and return UUID
|
||||||
console.log('Add watch object for item ' + this.#watchItemName + ' with state ' + params['targetState'] + ' and operator ' + operator + ' with UUID ' + watchUUID);
|
console.log('Add watch object for item ' + this.#watchItemName + ' with state ' + params['targetState'] + ' and operator ' + operator + ' with UUID ' + watchUUID);
|
||||||
this.#watchObjects[watchUUID] = {
|
this.#watchObjects[watchUUID] = {
|
||||||
targetState: this.#stateToValue(params['targetState']),
|
targetState: params['targetState'],
|
||||||
operator: operator,
|
operator: operator,
|
||||||
alertFunc: params['alertFunc'],
|
alertFunc: params['alertFunc'],
|
||||||
alertDelay: (params['alertDelay'] !== undefined) ? params['alertDelay'] : 0,
|
alertDelay: (params['alertDelay'] !== undefined) ? params['alertDelay'] : 0,
|
||||||
@@ -107,7 +107,7 @@ class Watch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#checkAlertState(watchUUID) {
|
#checkAlertState(watchUUID) {
|
||||||
let currentState = this.#stateToValue(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 (this.#compare(currentState, this.#watchObjects[watchUUID].targetState, this.#watchObjects[watchUUID].operator)) { // Comparison successful
|
||||||
|
|||||||
Reference in New Issue
Block a user