Forráskód Böngészése

add mode commands to http server

Chris Mullins 8 éve
szülő
commit
462621d4eb
1 módosított fájl, 12 hozzáadás és 0 törlés
  1. 12 0
      lib/WebServer/MiLightHttpServer.cpp

+ 12 - 0
lib/WebServer/MiLightHttpServer.cpp

@@ -246,6 +246,14 @@ void MiLightHttpServer::handleUpdateGroup(const UrlTokenBindings* urlBindings) {
     if (request["command"] == "temperature_down") {
       milightClient->decreaseTemperature();
     }
+    
+    if (request["command"] == "next_mode") {
+      milightClient->nextMode();
+    }
+    
+    if (request["command"] == "previous_mode") {
+      milightClient->previousMode();
+    }
   }
   
   if (request.containsKey("hue")) {
@@ -264,6 +272,10 @@ void MiLightHttpServer::handleUpdateGroup(const UrlTokenBindings* urlBindings) {
     milightClient->updateSaturation(request["saturation"]);
   }
   
+  if (request.containsKey("mode")) {
+    milightClient->updateMode(request["mode"]);
+  }
+  
   milightClient->setResendCount(settings.packetRepeats);
   
   server.send(200, "application/json", "true");