We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf870d3 commit 1387999Copy full SHA for 1387999
src/SomaShade.js
@@ -80,12 +80,11 @@ class SomaShade extends EventEmitter {
80
this.desiredPositionOnReconnect = position;
81
return;
82
}
83
- var that = this;
84
- this.movePercentCharacteristic.write(Buffer.from([closePercent.toString(16)]), false, function(error) {
+ this.movePercentCharacteristic.write(Buffer.from([closePercent.toString(16)]), false, function(error) => {
85
if (error) {
86
- that.log('ERROR writing to position - %o', error);
+ this.log('ERROR writing to position - %o', error);
87
} else if (position != that.position) {
88
- that.state = position > that.position ? 'opening' : 'closing';
+ this.state = position > this.position ? 'opening' : 'closing';
89
90
});
91
0 commit comments