@ente34 Ich stelle keinen Unterschied fest. Egal ob SetState oder setStateAsync
Hab nun folgendes Code und laut Log wird alles nacheinander abgearbeitet so wie ich es gerne hätte.
Gibt es vielleicht eine elegantere Lösung?
if(this.pathColortemp) {
await setState(this.pathTransistion, this.defaultTransition)
console.warn('1: Set Transition')
}
if(this.pathColortemp) {
await setState(this.pathColortemp, this.defaultColorTemp)
console.warn('2: Set Colortemp')
}
if(this.pathColor) {
await setState(this.pathColor, this.defaultColor)
console.warn('3: Set Color')
}
if(this.pathControl) {
await setState(this.pathControl, (this.pathControlType == 'number') ? this.defaultLevel : true)
console.warn('4: Set Control')
setState(this.pathLastValue, (this.pathControlType == 'number') ? this.defaultLevel : true, true);
console.warn('5: Set Light State')
setState(this.pathLightState, true, true);
console.warn('6: Set Group Light State')
if (extLogging) console.log(`${scriptname}: Licht wird eingeschaltet: ${this.name} // Pfad: ${this.pathControl} // Wert: ${(this.pathControlType == 'number') ? this.defaultLevel : true}`);
}