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