Commit 6efe9b2196f4a84aef99ae6df6d821270144661d

Authored by Nodeduino
Committed by Moritz Wirger
1 parent bc2e2d62

Fix error in SimpleColorHueStrategy

- error was that transitiontime was misspelled
hueplusplus/SimpleColorHueStrategy.cpp 100755 → 100644
@@ -30,7 +30,7 @@ bool SimpleColorHueStrategy::setColorHue(uint16_t hue, uint8_t transistion, HueL @@ -30,7 +30,7 @@ bool SimpleColorHueStrategy::setColorHue(uint16_t hue, uint8_t transistion, HueL
30 Json::Value request(Json::objectValue); 30 Json::Value request(Json::objectValue);
31 if (transistion != 4) 31 if (transistion != 4)
32 { 32 {
33 - request["transistiontime"] = transistion; 33 + request["transitiontime"] = transistion;
34 } 34 }
35 if (light.state["state"]["on"].asBool() != true) 35 if (light.state["state"]["on"].asBool() != true)
36 { 36 {
@@ -54,10 +54,10 @@ bool SimpleColorHueStrategy::setColorHue(uint16_t hue, uint8_t transistion, HueL @@ -54,10 +54,10 @@ bool SimpleColorHueStrategy::setColorHue(uint16_t hue, uint8_t transistion, HueL
54 std::string path = "/lights/" + std::to_string(light.id) + "/state/"; 54 std::string path = "/lights/" + std::to_string(light.id) + "/state/";
55 bool success = true; 55 bool success = true;
56 int i = 0; 56 int i = 0;
57 - if (success && request.isMember("transistiontime")) 57 + if (success && request.isMember("transitiontime"))
58 { 58 {
59 //Check if success was sent and the value was changed 59 //Check if success was sent and the value was changed
60 - success = !reply[i].isNull() && reply[i].isMember("success") && reply[i]["success"][path + "transistiontime"].asUInt() == request["transistiontime"].asUInt(); 60 + success = !reply[i].isNull() && reply[i].isMember("success") && reply[i]["success"][path + "transitiontime"].asUInt() == request["transitiontime"].asUInt();
61 ++i; 61 ++i;
62 } 62 }
63 if (success && request.isMember("on")) 63 if (success && request.isMember("on"))
@@ -80,7 +80,7 @@ bool SimpleColorHueStrategy::setColorSaturation(uint8_t sat, uint8_t transistion @@ -80,7 +80,7 @@ bool SimpleColorHueStrategy::setColorSaturation(uint8_t sat, uint8_t transistion
80 Json::Value request(Json::objectValue); 80 Json::Value request(Json::objectValue);
81 if (transistion != 4) 81 if (transistion != 4)
82 { 82 {
83 - request["transistiontime"] = transistion; 83 + request["transitiontime"] = transistion;
84 } 84 }
85 if (light.state["state"]["on"].asBool() != true) 85 if (light.state["state"]["on"].asBool() != true)
86 { 86 {
@@ -107,10 +107,10 @@ bool SimpleColorHueStrategy::setColorSaturation(uint8_t sat, uint8_t transistion @@ -107,10 +107,10 @@ bool SimpleColorHueStrategy::setColorSaturation(uint8_t sat, uint8_t transistion
107 std::string path = "/lights/" + std::to_string(light.id) + "/state/"; 107 std::string path = "/lights/" + std::to_string(light.id) + "/state/";
108 bool success = true; 108 bool success = true;
109 int i = 0; 109 int i = 0;
110 - if (success && request.isMember("transistiontime")) 110 + if (success && request.isMember("transitiontime"))
111 { 111 {
112 //Check if success was sent and the value was changed 112 //Check if success was sent and the value was changed
113 - success = !reply[i].isNull() && reply[i].isMember("success") && reply[i]["success"][path + "transistiontime"].asUInt() == request["transistiontime"].asUInt(); 113 + success = !reply[i].isNull() && reply[i].isMember("success") && reply[i]["success"][path + "transitiontime"].asUInt() == request["transitiontime"].asUInt();
114 ++i; 114 ++i;
115 } 115 }
116 if (success && request.isMember("on")) 116 if (success && request.isMember("on"))