Add Yeelight music mode, enabled with "music_mode" option in Yeelight configuration. Probably only works for one light right now.

This commit is contained in:
Adam Honse committed 2021-03-29 18:52:38 -05:00
1 parent a5a9482206
commit 3e9993a6a4
4 files changed
+172 -20

No files matched your search

@@ -37,8 +37,14 @@ void DetectYeelightControllers(std::vector<RGBController*> &rgb_controllers)
if(yeelight_settings["devices"][device_idx].contains("ip"))
{
std::string yeelight_ip = yeelight_settings["devices"][device_idx]["ip"];
bool music_mode = false;
new_controller = new YeelightController(yeelight_ip);
if(yeelight_settings["devices"][device_idx].contains("music_mode"))
{
music_mode = yeelight_settings["devices"][device_idx]["music_mode"];
}
new_controller = new YeelightController(yeelight_ip, music_mode);
new_rgbcontroller = new RGBController_Yeelight(new_controller);
rgb_controllers.push_back(new_rgbcontroller);