| | |
| | | return; |
| | | if (uFunction.functionType == bodyView.light.functionType && uFunction.sid == bodyView.light.sid) |
| | | { |
| | | bodyView.dimmerBar.Progress = uFunction.brightness; |
| | | if (!bodyView.onDimmerBar) |
| | | { |
| | | bodyView.dimmerBar.Progress = uFunction.brightness; |
| | | } |
| | | |
| | | if (uFunction.trait_on_off.value.ToString() == "on") |
| | | { |
| | |
| | | light.refreshTime = DateTime.Now; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | //Control.Send(CommandType_A.write, light); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("brightness", light.brightness.ToString()); |
| | | Control.SendWriteCommand(light, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | else |
| | | { |
| | | MainPage.Log("skip control!!"); |
| | | } |
| | | } |
| | | |
| | | MainPage.Log( dimmerBar.NowProgressY.ToString()); |
| | | //btnBrightnessText.Y = dimmerBar.NowProgressY + Application.GetRealWidth(40); |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40); |
| | | btnBrightnessText.Text = light.brightness + "%"; |
| | | }; |
| | | } |
| | | |