Skip to content

WIP: Add background light support

Hi

thanks for great library ! I want to add support for background light ( ambilight style ? ) for ceiling light 650. I've started adding bg_ version method and I'm wondering how to approach methods like set_rgb / set_hsv etc. They some some logic inside. I can copy them with bg_ in name like set_bg_rgb, but that would duplicate some code. Do you have any thoughts how to approach it ? I could extract that methods body to some internal methods, that will get argument with command name, returned for _command wrapper ? Or maybe something different :D

EDIT: After looking at HA possible integration and more at the code. Maybe we could add new model, like ambilight or background light etc, and in all methods choose command send to yeelight, according to model. So Bulb with model background_light, will send set_bg_power in turn_on, instead of set_power, etc. And do this for all methods that exists in bg_ variant ?

Edited by Michał Ciemięga

Merge request reports