cellcortex / homebridge-yeelighter

Homebridge plugin for Yeelights - special focus on supporting features of ceiling lights
MIT License
98 stars 19 forks source link

Feature Improvement: Moonlight Mode minimum brightness #145

Open reachteh opened 9 months ago

reachteh commented 9 months ago

Hi, I have a small suggestion for improvement regarding the Moonlight Mode. I own a Yeelight Ceiling Light in my bedroom and I have a sleep scene that I want to be as dark as possible. Currently, I am using another Yeelight plugin because, unfortunately, with your plugin, the minimum brightness in Moonlight mode is much brighter than with my other Homebridge plugin. I looked through the code and think I found the problem. When the brightness of the lamp is set to 1% in Homekit, the command is still sent with 2%. For my lamp, this feels twice as bright as 1%.

temperaturelightservice.ts in Line 124 is this: valueToSet = Math.max(1, (value - 50) * 2);

Would it maybe possible to substract 1 by default in moonlight mode?

Would greatly appreciate if you could look into this and potentially provide a fix. I really admire your work and I'm grateful for your dedication to improving the plugin. Thank you in advance for considering my feedback and for all your hard work!