Explorar el Código

Add night_mode to CCT command parser

Christopher Mullins hace 6 años
padre
commit
592242fbd4
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      lib/MiLight/CctPacketFormatter.cpp

+ 4 - 1
lib/MiLight/CctPacketFormatter.cpp

@@ -199,7 +199,10 @@ BulbId CctPacketFormatter::parsePacket(const uint8_t* packet, JsonObject result)
     REMOTE_TYPE_CCT
   );
 
-  if (onOffGroupId < 255) {
+  // Night mode
+  if (command & 0x10) {
+    result["command"] = "night_mode";
+  } else if (onOffGroupId < 255) {
     result["state"] = cctCommandToStatus(command) == ON ? "ON" : "OFF";
   } else if (command == CCT_BRIGHTNESS_DOWN) {
     result["command"] = "brightness_down";