From e0c5909757149c6df5fe4157fe9fc2a3c8762c5f Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Sat, 3 Apr 2021 13:15:12 -0500 Subject: [PATCH] Fix some issues with Yeelight that prevented a different model bulb from working --- Controllers/YeelightController/YeelightController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controllers/YeelightController/YeelightController.cpp b/Controllers/YeelightController/YeelightController.cpp index 7cf77bc20..4bd3caa39 100644 --- a/Controllers/YeelightController/YeelightController.cpp +++ b/Controllers/YeelightController/YeelightController.cpp @@ -158,7 +158,7 @@ void YeelightController::SetPower() \*-----------------------------------------------------------------*/ command["id"] = 1; command["method"] = "set_power"; - command["params"][0] = 1; + command["params"][0] = "on"; command["params"][1] = "sudden"; command["params"][2] = 0; command["params"][3] = 2; @@ -208,7 +208,7 @@ void YeelightController::SetColor(unsigned char red, unsigned char green, unsign | set_cf option provides both RGB and brightness in one command, it | | allows better RGB control than the set_rgb function. | \*-----------------------------------------------------------------*/ - std::string cf = "\"0,1," + std::to_string(rgb) +"," + std::to_string(bright) +"\""; + std::string cf = "50,1," + std::to_string(rgb) +"," + std::to_string((int)bright); /*-----------------------------------------------------------------*\ | Fill in the set_cf command with the color flow string. |