| | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", function.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | if (function.spk == SPK.LightDimming || function.spk == SPK.LightRGB) |
| | | { |
| | | var light = function as Light; |
| | | d.Add(FunctionAttributeKey.OnOff, light.trait_on_off.curValue.ToString()); |
| | | if (btnSwitch.IsSelected) |
| | | { |
| | | d.Add(FunctionAttributeKey.Brightness, light.lastBrightness.ToString()); |
| | | } |
| | | else |
| | | { |
| | | light.lastBrightness = light.brightness; |
| | | } |
| | | Control.Ins.SendWriteCommand(light, d); |
| | | } |
| | | else |
| | | { |
| | | d.Add("on_off", function.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | |
| | | { |
| | | ShowMesBtnState(pushMessageInfoList[0], true); |
| | | }); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | isGetting = false; |
| | | } |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |