Skip to content

Commit 1387999

Browse files
Use arrow functions universally
1 parent bf870d3 commit 1387999

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/SomaShade.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,11 @@ class SomaShade extends EventEmitter {
8080
this.desiredPositionOnReconnect = position;
8181
return;
8282
}
83-
var that = this;
84-
this.movePercentCharacteristic.write(Buffer.from([closePercent.toString(16)]), false, function(error) {
83+
this.movePercentCharacteristic.write(Buffer.from([closePercent.toString(16)]), false, function(error) => {
8584
if (error) {
86-
that.log('ERROR writing to position - %o', error);
85+
this.log('ERROR writing to position - %o', error);
8786
} else if (position != that.position) {
88-
that.state = position > that.position ? 'opening' : 'closing';
87+
this.state = position > this.position ? 'opening' : 'closing';
8988
}
9089
});
9190
}

0 commit comments

Comments
 (0)