Skip to content

Commit

Permalink
Use arrow functions universally
Browse files Browse the repository at this point in the history
  • Loading branch information
andersonshatch committed Aug 30, 2019
1 parent bf870d3 commit 1387999
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/SomaShade.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@ class SomaShade extends EventEmitter {
this.desiredPositionOnReconnect = position;
return;
}
var that = this;
this.movePercentCharacteristic.write(Buffer.from([closePercent.toString(16)]), false, function(error) {
this.movePercentCharacteristic.write(Buffer.from([closePercent.toString(16)]), false, function(error) => {
if (error) {
that.log('ERROR writing to position - %o', error);
this.log('ERROR writing to position - %o', error);
} else if (position != that.position) {
that.state = position > that.position ? 'opening' : 'closing';
this.state = position > this.position ? 'opening' : 'closing';
}
});
}
Expand Down

0 comments on commit 1387999

Please sign in to comment.