diff --git a/main.js b/main.js index 19c4a41..a5e7370 100644 --- a/main.js +++ b/main.js @@ -45,26 +45,8 @@ class Jablotron extends utils.Adapter { } } - // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. - this.subscribeStates('testVariable'); - // You can also add a subscription for multiple states. The following line watches all states starting with "lights." - // this.subscribeStates('lights.*'); - // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: - // this.subscribeStates('*'); - - /* - setState examples - you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) - */ - // the variable testVariable is set to true as command (ack=false) - await this.setStateAsync('testVariable', true); - - // same thing, but the value is flagged "ack" - // ack should be always set to true if the value is received from or acknowledged from the target system - await this.setStateAsync('testVariable', { val: true, ack: true }); - - // same thing, but the state is deleted after 30s (getState will return null afterwards) - await this.setStateAsync('testVariable', { val: true, ack: true, expire: 30 }); + // subscribe to all state changes + this.subscribeStates('status.alarm'); }