From d41f1d4a478c1afcc43f3a5abb0ba76e376bc7c1 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期二, 09 三月 2021 15:23:25 +0800 Subject: [PATCH] 2 --- HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWaterValvePage.cs | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWaterValvePage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWaterValvePage.cs index 3f81d26..b652cf6 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWaterValvePage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWaterValvePage.cs @@ -42,14 +42,18 @@ /// </summary> public override void InitFrameWhiteContent() { - base.SetTitleText(Language.StringByID(StringId.AirCleaner)); + base.SetTitleText(Language.StringByID(StringId.WaterValve)); - ////娣诲姞绗簩绱㈠紩椤� - //this.AddSecondPage(); //鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� this.InitFrameWhiteContent1(); //鍒锋柊鐣岄潰鐘舵�� this.RefreshFormStatu(); + //璇诲彇鐘舵�� + new System.Threading.Thread(() => + { + Control.Ins.ReadFunctionsInfo(new List<string>() { device.deviceId}); + }) + { IsBackground = true }.Start(); } /// <summary> @@ -176,12 +180,12 @@ { Application.RunOnMainThread(() => { - var onoffStatu = device.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff); - var timeStatu = device.status.Find((obj) => obj.key == FunctionAttributeKey.TuyaWaterTime); + var onoffStatu = device.attributes.Find((obj) => obj.key == FunctionAttributeKey.OnOff); + var timeStatu = device.attributes.Find((obj) => obj.key == FunctionAttributeKey.TuyaWaterTime); if (onoffStatu != null) { - if (onoffStatu.value.ToString() == "on") + if (onoffStatu.state == "on") { btnControlTip.TextID = StringId.ControllerOn; } @@ -189,11 +193,11 @@ { btnControlTip.TextID = StringId.ControllerNotOn; } - this.btnSwitch.IsSelected = this.btnPictrue.IsSelected = onoffStatu.value.ToString() == "on"; + this.btnSwitch.IsSelected = this.btnPictrue.IsSelected = onoffStatu.state.ToString() == "on"; } if (timeStatu != null) { - int.TryParse(timeStatu.value, out waterRunningTime); + int.TryParse(timeStatu.state, out waterRunningTime); } RefreshTimeButton(); }); @@ -254,6 +258,7 @@ private void SetControlTime() { var timeControl = new BottomTimeSelectControl(); + timeControl.RowCount = 5; timeControl.InitControl(0,0); timeControl.FinishEvent = (type,hours,min) => { if (type == 1)//0:鍙栨秷锛�1:纭畾 -- Gitblit v1.8.0