Explorar o código

CCT: dont treat on/off as unhandled

Chris Mullins %!s(int64=8) %!d(string=hai) anos
pai
achega
9869fcc4c3
Modificáronse 1 ficheiros con 1 adicións e 3 borrados
  1. 1 3
      lib/MiLight/CctPacketFormatter.cpp

+ 1 - 3
lib/MiLight/CctPacketFormatter.cpp

@@ -156,9 +156,7 @@ void CctPacketFormatter::parsePacket(const uint8_t* packet, JsonObject& result)
   uint8_t onOffGroupId = cctCommandIdToGroup(command);
   if (onOffGroupId < 255) {
     result["state"] = cctCommandToStatus(command) == ON ? "ON" : "OFF";
-  }
-
-  if (command == CCT_BRIGHTNESS_DOWN) {
+  } else if (command == CCT_BRIGHTNESS_DOWN) {
     result["command"] = "brightness_down";
   } else if (command == CCT_BRIGHTNESS_UP) {
     result["command"] = "brightness_up";