Explorar o código

handle mode speed, mode for RGBW

Chris Mullins %!s(int64=8) %!d(string=hai) anos
pai
achega
65ff9b6e25
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      lib/MiLight/RgbwPacketFormatter.cpp

+ 6 - 0
lib/MiLight/RgbwPacketFormatter.cpp

@@ -116,6 +116,12 @@ void RgbwPacketFormatter::parsePacket(const uint8_t* packet, JsonObject& result)
     uint16_t remappedColor = Units::rescale<uint16_t, uint16_t>(packet[RGBW_COLOR_INDEX], 360.0, 255.0);
     remappedColor = (remappedColor + 320) % 360;
     result["hue"] = remappedColor;
+  } else if (command == RGBW_SPEED_DOWN) {
+    result["command"] = "mode_speed_down";
+  } else if (command == RGBW_SPEED_UP) {
+    result["command"] = "mode_speed_up";
+  } else if (command == RGBW_DISCO_MODE) {
+    result["mode"] = packet[0] & ~RGBW;
   } else {
     result["button_id"] = command;
   }