MariusRumpf / node-lifx

Node.js implementation of the LIFX LAN protocol :bulb:
MIT License
144 stars 28 forks source link

Fix scaling issues #38

Closed devbobo closed 8 years ago

devbobo commented 8 years ago

node-lifx has always had issues with scaling. Quite often the scaling with node-lifx doesn't match what the LIFX app is showing.

Math.round should be used instead of Math.floor.

For test purposes, set Brightness to 49% and then read back the corresponding value and it will read 48%.

This PR resolves that discrepancy.

ristomatti commented 8 years ago

I've noticed this issue also. I hope this PR gets merged!

codecov-io commented 8 years ago

Current coverage is 57.82% (diff: 50.00%)

Merging #38 into master will not change coverage

@@             master        #38   diff @@
==========================================
  Files            42         42          
  Lines          1252       1252          
  Methods         103        103          
  Messages          0          0          
  Branches        195        195          
==========================================
  Hits            724        724          
  Misses          528        528          
  Partials          0          0          

Powered by Codecov. Last update bd30a43...239ba35

MariusRumpf commented 8 years ago

Does look good, thanks for your work!