Procházet zdrojové kódy

add support for handling raw command / arg bytes

Chris Mullins před 8 roky
rodič
revize
837237e7b8
1 změnil soubory, kde provedl 5 přidání a 0 odebrání
  1. 5 0
      lib/MiLight/MiLightClient.cpp

+ 5 - 0
lib/MiLight/MiLightClient.cpp

@@ -315,6 +315,11 @@ void MiLightClient::update(const JsonObject& request) {
     this->updateMode(request["mode"]);
   }
 
+  // Raw packet command/args
+  if (request.containsKey("button_id") && request.containsKey("argument")) {
+    this->command(request["button_id"], request["argument"]);
+  }
+
   // Always turn off last
   if (parsedStatus == OFF) {
     this->updateStatus(OFF);