浏览代码

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;
     }
   }
 }