Пример #1
0
        private JsonResult PutRequest(BaseActuator actuator, string parameter, SetCommandParameterModel data)
        {
            Console.WriteLine("Received PUT request with payload:");
            Console.WriteLine(JsonConvert.SerializeObject(data));

            ModifyData(actuator, parameter, data.Value);

            return(new JsonResult(
                       new
            {
                message = "Parameter set!"
            }
                       ));
        }
Пример #2
0
 public ActionResult <string> PutAirCoolerMin(SetCommandParameterModel data)
 {
     return(PutRequest(airCooler, "MIN", data));
 }
Пример #3
0
 public ActionResult <string> PutWaterPumpMin(SetCommandParameterModel data)
 {
     return(PutRequest(waterPump, "MIN", data));
 }
Пример #4
0
 public ActionResult <string> PutHumidifierMin(SetCommandParameterModel data)
 {
     return(PutRequest(humidifier, "MIN", data));
 }
Пример #5
0
 public ActionResult <string> PutAirCoolerOffset(SetCommandParameterModel data)
 {
     return(PutRequest(airCooler, "OFFSET", data));
 }
Пример #6
0
 public ActionResult <string> PutWaterPumpOffset(SetCommandParameterModel data)
 {
     return(PutRequest(waterPump, "OFFSET", data));
 }
Пример #7
0
 public ActionResult <string> PutHumidifierOffset(SetCommandParameterModel data)
 {
     return(PutRequest(humidifier, "OFFSET", data));
 }