rafaelborja / SmartthingsKingOfFansZigbee

Smartthings device handler for Home Depot Home Decorators Zigbee Fan (and fan controller) produced by King of Fans. This device handler is based on https://github.com/dcoffing/KOF-CeilingFan, refectored to work with new Smartthing app and to provide simpler user experience.
Apache License 2.0
28 stars 116 forks source link

Update king-of-fans-zigbee-fan-controller.groovy #13

Closed jakeevan closed 3 years ago

jakeevan commented 4 years ago

Since round() will round to the nearest integer (up or down), your 25%, 50%, 75%, 100% was resulting in values of 1, 3, 4, 5, respectively. The code I'm proposing here should fix that (I believe floor will return 0 if you pass null into it, so I got rid of that check as well).

rafaelborja commented 4 years ago

Hi @jakeevan

I just merged another PR fixing the issue (sorry, it was just the first one in order). Could you confirm if the round change is still needed?