Просмотр исходного кода

Fix night_mode parsing for RGBW packet parser

Christopher Mullins лет назад: 6
Родитель
Сommit
c1419dbc62
1 измененных файлов с 1 добавлено и 2 удалено
  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";