ソースを参照

Fix code style issues. Rename constant

Bijesh Krishnadas 8 年 前
コミット
17b1e33b7d
共有2 個のファイルを変更した3 個の追加6 個の削除を含む
  1. 2 5
      lib/MiLight/MiLightClient.cpp
  2. 1 1
      lib/MiLight/MiLightClient.h

+ 2 - 5
lib/MiLight/MiLightClient.cpp

@@ -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);

+ 1 - 1
lib/MiLight/MiLightClient.h

@@ -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: