corbanmailloux / esp-mqtt-rgb-led

MQTT RGB LEDs Using JSON for Home Assistant
MIT License
270 stars 74 forks source link

Add support for custom input range #46

Closed danobot closed 5 years ago

danobot commented 6 years ago

This tweak allows for a configurable brightness input range. If the LED strip hardware does not support brightness values below 150 (because the LED strip cannot operate at that low a voltage), the user can specify a min and a max brightness value. The advantage of this is that the full range of values (0-255) can be used in Home Assistant, while internally it is converted to the requirements of the hardware (150-255).

Have applied this to brightness only because that is my use case. If this is a feature you want to merge let me know and we can discuss how to apply it to all RGB values.

corbanmailloux commented 5 years ago

I'm not sure how useful this change is for most people. I guess it makes sense, but I'm surprised if your LEDs are really off at ~59% (150/255). That seems like more of a LED or wiring issue in this case.

Do you think this is generally applicable for most light sets?

danobot commented 5 years ago

It depends on the type of LED. Some get really dim very quick. It's a relatively simple change and it's readable in that people understand what is going on as soon as they see the map function and constants.