@@ -268,12 +268,9 @@ void MiLightClient::update(const JsonObject& request) {
uint8_t g = color["g"];
uint8_t b = color["b"];
//If close to white
- if( r > 256 - RGB_BOUNDARY && g > 256 - RGB_BOUNDARY && b > 256 - RGB_BOUNDARY)
- {
+ if( r > 256 - RGB_WHITE_BOUNDARY && g > 256 - RGB_WHITE_BOUNDARY && b > 256 - RGB_WHITE_BOUNDARY) {
this->updateColorWhite();
- }
- else
+ } else {
double hsv[3];
RGBConverter converter;
converter.rgbToHsv(r, g, b, hsv);
@@ -12,7 +12,7 @@
#define MILIGHT_DEFAULT_RESEND_COUNT 10
//Used to determine close to white
-#define RGB_BOUNDARY 40
+#define RGB_WHITE_BOUNDARY 40
class MiLightClient {
public: