Skip to content

Commit

Permalink
reset Yeelight.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Corbin committed Dec 9, 2016
1 parent de54b15 commit d10e942
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions hardware/Yeelight.cpp
Expand Up @@ -283,12 +283,12 @@ bool Yeelight::WriteToHardware(const char *pdata, const unsigned char length)
message = ss.str();
break;
case Limitless_SetRGBColour: {
sendOnFirst = true;
float cHue = (359.0f / 255.0f)*float(pLed->value); // hue given was in range of 0-255
ss << "{\"id\":1,\"method\":\"set_hsv\",\"params\":[" << cHue << ", 100, \"smooth\", 2000]}\r\n";
message = ss.str();
}
break;
sendOnFirst = true;
float cHue = (359.0f / 255.0f)*float(pLed->value); // hue given was in range of 0-255
ss << "{\"id\":1,\"method\":\"set_hsv\",\"params\":[" << cHue << ", 100, \"smooth\", 2000]}\r\n";
message = ss.str();
}
break;
case Limitless_SetBrightUp:
message = "{\"id\":1,\"method\":\"set_adjust\",\"params\":[\"increase\", \"bright\"]}\r\n";
break;
Expand All @@ -312,12 +312,12 @@ bool Yeelight::WriteToHardware(const char *pdata, const unsigned char length)
}
break;
case Limitless_FullBrightness: {
sendOnFirst = true;
int value = pLed->value;
ss << "{\"id\":1,\"method\":\"set_bright\",\"params\":[100, \"smooth\", 500]}\r\n";
message = ss.str();
}
break;
sendOnFirst = true;
int value = pLed->value;
ss << "{\"id\":1,\"method\":\"set_bright\",\"params\":[100, \"smooth\", 500]}\r\n";
message = ss.str();
}
break;
case Limitless_DiscoMode:
sendOnFirst = true;
// simulate strobe effect - at time of writing, minimum timing allowed by Yeelight is 50ms
Expand Down

0 comments on commit d10e942

Please sign in to comment.