Prechádzať zdrojové kódy

Fix night_mode parsing for RGBW packet parser

Christopher Mullins 6 rokov pred
rodič
commit
c1419dbc62
1 zmenil súbory, kde vykonal 1 pridanie a 2 odobranie
  1. 1 2
      lib/MiLight/RgbwPacketFormatter.cpp

+ 1 - 2
lib/MiLight/RgbwPacketFormatter.cpp

@@ -124,9 +124,8 @@ BulbId RgbwPacketFormatter::parsePacket(const uint8_t* packet, JsonObject result
     // the last packet sent, not the current one, and that can be wrong for
     // on/off commands.
     bulbId.groupId = GROUP_FOR_STATUS_COMMAND(command);
-  } else if (command >= RGBW_ALL_MAX_LEVEL && command <= RGBW_GROUP_4_MIN_LEVEL) {
+  } else if (command & 0x10) {
     if ((command % 2) == 0) {
-      result["state"] = "ON";
       result["command"] = "night_mode";
     } else {
       result["command"] = "set_white";