소스 검색

pull group from arg -- remote doesnt send correct values

Chris Mullins 8 년 전
부모
커밋
397a8e23ab
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      lib/MiLight/RgbCctPacketFormatter.cpp

+ 3 - 1
lib/MiLight/RgbCctPacketFormatter.cpp

@@ -122,11 +122,13 @@ void RgbCctPacketFormatter::parsePacket(const uint8_t *packet, JsonObject& resul
   uint8_t command = packetCopy[RGB_CCT_COMMAND_INDEX];
   uint8_t arg = packetCopy[RGB_CCT_ARGUMENT_INDEX];
 
-  if (command == RGB_CCT_ON) {
+  if ((command & 0x7F) == RGB_CCT_ON) {
     if (arg < 5) {
       result["status"] = "on";
+      result["group_id"] = arg;
     } else {
       result["status"] = "off";
+      result["group_id"] = arg-5;
     }
   }
 }