| | |
| | | var commonNew = Newtonsoft.Json.JsonConvert.DeserializeObject<LightDimming> (jsonInfo); |
| | | var mSceneFunction = new SceneFunction (); |
| | | mSceneFunction.sid = function.sid; |
| | | //1.Brightness |
| | | //1.on_off |
| | | var status = new List<SceneFunctionStatus> (); |
| | | status.Add (new SceneFunctionStatus () { |
| | | key = FunctionAttributeKey.OnOff, |
| | | value = commonNew.CurrentBrightness > 0 ? "on" : "off", |
| | | }); |
| | | //2.Brightness |
| | | status.Add (new SceneFunctionStatus () { |
| | | key = FunctionAttributeKey.Brightness, |
| | | value = commonNew.CurrentBrightness.ToString(), |
| | | }); |
| | | //2.Delay |
| | | //3.Delay |
| | | status.Add (new SceneFunctionStatus () { |
| | | key = FunctionAttributeKey.Delay, |
| | | value = (commonNew.DelayTimeHeight * 256 + commonNew.DelayTimeLow).ToString (), |
| | |
| | | var commonNew = Newtonsoft.Json.JsonConvert.DeserializeObject<LightLogic> (jsonInfo); |
| | | var mSceneFunction = new SceneFunction (); |
| | | mSceneFunction.sid = function.sid; |
| | | //1.Brightness |
| | | //1.on_off |
| | | var status = new List<SceneFunctionStatus> (); |
| | | status.Add (new SceneFunctionStatus () { |
| | | key = FunctionAttributeKey.OnOff, |
| | | value = commonNew.CurrentBrightness > 0 ? "on" : "off", |
| | | }); |
| | | //2.Brightness |
| | | status.Add (new SceneFunctionStatus () { |
| | | key = FunctionAttributeKey.Brightness, |
| | | value = commonNew.CurrentBrightness.ToString (), |
| | | }); |
| | | //2.Delay |
| | | //3.Delay |
| | | status.Add (new SceneFunctionStatus () { |
| | | key = FunctionAttributeKey.Delay, |
| | | value = (commonNew.DelayTimeHeigh * 256 + commonNew.DelayTimeLow).ToString (), |
| | | }); |
| | | |
| | | //3.rgb |
| | | //4.rgb |
| | | status.Add (new SceneFunctionStatus () { |
| | | key = FunctionAttributeKey.RGB, |
| | | value = commonNew.RStatus + "," + commonNew.GStatus + "," + commonNew.BStatus, |
| | |
| | | var commonNew = Newtonsoft.Json.JsonConvert.DeserializeObject<LightSwitch> (jsonInfo); |
| | | var mSceneFunction = new SceneFunction (); |
| | | mSceneFunction.sid = function.sid; |
| | | //1.Brightness |
| | | //1.OnOff |
| | | var status = new List<SceneFunctionStatus> (); |
| | | status.Add (new SceneFunctionStatus () { |
| | | key = FunctionAttributeKey.OnOff, |