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.
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).
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).