Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add start_flow service to yeelight with an ability to declare custom effects #20107
Added support for declaring custom effects for yeelight platform. I wanted to recreate yeelight app effects, like fire flicker. Didn't want to hardcore anything in python-yeelight, as probably everyone will want to tweak some effects etc. Also exposed service to start flow with custom transitions. Use case is to control brightness / duration etc using some templates / dynamic values.
Example entry for
referenced this pull request
Jan 14, 2019
rytilahti left a comment •
I have now tested this briefly and it seemed to work fine, I think this is a really good addition! :-)
One nitpicky thing that I don't like that much is how the parameters are passed -- it took reading the code to know what the parameters are, e.g., for TemperatureTransition (temperature, time_in_milliseconds, brightness). This could be alleviated by using by passing keyword arguments as a dict, but it may not be worth the effort and could be fixed by improving the documentation.
In my opinion this is ready to be merged as soon as the documentation PR is approved.
I was thinking about dict params, but after looking at config with it, it was long and another level of nesting. Also they don't have default values, so all of them are needs to be specified. After writing some test examples, they were quite easy to guess, as value ranges differs. That was my reasoning, maybe we could make support for both. Or wait for more feedback to design it better ? I don't have strong opinions about any of the solution, so I've choosen simpler / shorter. Thanks for approval !