コード例 #1
0
        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));
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
        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());
        }