The setStateAsync method has been deprecated in favor of the setState method. Newly created adapters will now use the current recommended API. If you have an existing adapter using setStateAsync, you should update it to use setState instead.
The adapter template generation was updated to use await this.setState() instead of await this.setStateAsync() for setting states.
If you have an existing adapter that uses setStateAsync, you should replace all occurrences with the setState method:
// Before (deprecated)
- await this.setStateAsync("testVariable", true);
- await this.setStateAsync("testVariable", { val: true, ack: true });
- await this.setStateAsync("testVariable", { val: true, ack: true, expire: 30 });
// After (current)
+ await this.setState("testVariable", true);
+ await this.setState("testVariable", { val: true, ack: true });
+ await this.setState("testVariable", { val: true, ack: true, expire: 30 });The setStateAsync method was deprecated in favor of the simpler setState method:
setStatewhen called without a callback returns a Promise and should be awaitedsetStatewhen called with a callback is synchronous- Using
setStatealigns with current ioBroker adapter development best practices
This change does not affect the functionality of your adapter - both methods perform the same operation. The only difference is using the current recommended API instead of the deprecated one.