瀏覽代碼

dont unconditionally set state

Chris Mullins 8 年之前
父節點
當前提交
c8b6b9c732

+ 0 - 4
lib/MiLight/CctPacketFormatter.cpp

@@ -167,10 +167,6 @@ void CctPacketFormatter::parsePacket(const uint8_t* packet, JsonObject& result,
   } else {
     result["button_id"] = command;
   }
-
-  if (! result.containsKey("state")) {
-    result["state"] = "ON";
-  }
 }
 
 void CctPacketFormatter::format(uint8_t const* packet, char* buffer) {

+ 0 - 4
lib/MiLight/FUT089PacketFormatter.cpp

@@ -102,8 +102,4 @@ void FUT089PacketFormatter::parsePacket(const uint8_t *packet, JsonObject& resul
     result["button_id"] = command;
     result["argument"] = arg;
   }
-
-  if (! result.containsKey("state")) {
-    result["state"] = "ON";
-  }
 }

+ 0 - 4
lib/MiLight/RgbCctPacketFormatter.cpp

@@ -119,8 +119,4 @@ void RgbCctPacketFormatter::parsePacket(const uint8_t *packet, JsonObject& resul
     result["button_id"] = command;
     result["argument"] = arg;
   }
-
-  if (! result.containsKey("state")) {
-    result["state"] = "ON";
-  }
 }

+ 0 - 4
lib/MiLight/RgbPacketFormatter.cpp

@@ -105,10 +105,6 @@ void RgbPacketFormatter::parsePacket(const uint8_t* packet, JsonObject& result,
   } else {
     result["button_id"] = command;
   }
-
-  if (! result.containsKey("state")) {
-    result["state"] = "ON";
-  }
 }
 
 void RgbPacketFormatter::format(uint8_t const* packet, char* buffer) {

+ 0 - 4
lib/MiLight/RgbwPacketFormatter.cpp

@@ -125,10 +125,6 @@ void RgbwPacketFormatter::parsePacket(const uint8_t* packet, JsonObject& result,
   } else {
     result["button_id"] = command;
   }
-
-  if (! result.containsKey("state")) {
-    result["state"] = "ON";
-  }
 }
 
 void RgbwPacketFormatter::format(uint8_t const* packet, char* buffer) {