public IActionResult PostShow([FromBody] JObject myDevice) { LogUtil.Write(@"Did it work (ambient Show)? " + JsonConvert.SerializeObject(myDevice)); DreamSender.SendMessage("ambientScene", myDevice.GetValue("scene"), (string)myDevice.GetValue("id")); //NotifyClients(); return(Ok(myDevice)); }
public IActionResult PostAmbientMode([FromBody] JObject myDevice) { LogUtil.Write(@"Did it work (ambient Mode)? " + JsonConvert.SerializeObject(myDevice)); DreamSender.SendMessage("ambientModeType", (int)myDevice.GetValue("mode"), (string)myDevice.GetValue("id")); //NotifyClients(); return(Ok("Ok")); }
public IActionResult UpdateDs([FromBody] JObject dsSetting) { if (dsSetting == null) { throw new ArgumentException("Invalid Jobject."); } var id = (dsSetting["Id"] ?? "").Value <string>(); var property = (dsSetting["Property"] ?? "").Value <string>(); var value = (dsSetting["Value"] ?? "").Value <string>(); LogUtil.Write($"We got our stuff: {id}, {property}, {value}"); DreamSender.SendMessage(property, value, id); NotifyClients(); return(Ok()); }