lss
2020-06-12 9c16d3614d9b88c637f967518a329f239fcd3aaf
ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
@@ -79,8 +79,8 @@
            //房间图片
            var btnPic = new ImageView();
            btnPic.Y = Application.GetRealHeight(60);
            btnPic.Width = Application.GetMinRealAverage(824);
            btnPic.Height = Application.GetMinRealAverage(549);
            btnPic.Width = this.GetPictrueRealSize(824);
            btnPic.Height = this.GetPictrueRealSize(549);
            btnPic.Radius = (uint)Application.GetRealHeight(17);
            btnPic.Gravity = Gravity.CenterHorizontal;
            btnPic.ImagePath = "RoomIcon/0.jpg";
@@ -213,6 +213,9 @@
                {
                    newRoom.Temperatrue = 0;
                }
                //添加房间,主页需要重新刷新
                UserView.UserPage.Instance.RefreshForm = true;
                HdlRoomLogic.Current.AddRoom(newRoom);
                this.FinishEditorEvent?.Invoke();
@@ -382,6 +385,10 @@
                {
                    listDevice.Add(device);
                }
                else if (device.Type == ZigBee.Device.DeviceType.FreshAirHumiditySensor)
                {
                    listDevice.Add(device);
                }
            }
            var listSelect = new List<string>() { newRoom.HumidityDevice };
            var form = new SelectDeviceForm();
@@ -437,7 +444,8 @@
                    {
                        HdlThreadLogic.Current.RunMain(() =>
                        {
                            if (data.AttriButeData == 0)
                            decimal humidity = (decimal)device.GetType().InvokeMember("Humidity", System.Reflection.BindingFlags.GetField, null, device, null);
                            if (humidity == 0)
                            {
                                //0
                                btnHumi.Text = "0.0%";
@@ -445,11 +453,8 @@
                            }
                            else
                            {
                                //小数点需要一位(湿度没有负数)
                                string strValue = data.AttriButeData.ToString();
                                strValue = strValue.Substring(0, strValue.Length - 1);
                                //记录湿度
                                this.newRoom.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, "."));
                                this.newRoom.Humidity = humidity;
                                btnHumi.Text = this.newRoom.Humidity.ToString() + "%";
                            }
                        });
@@ -457,7 +462,7 @@
                }
            });
            //发送获取湿度的命令
            ((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity();
            device.GetType().InvokeMember("ReadTemperatureOrHumidity", System.Reflection.BindingFlags.InvokeMethod, null, device, null);
        }
        #endregion