HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-05-19 7dd4be37cdedaf81ad40990d8cb8dce164d83f4d
34444444
26个文件已修改
1054 ■■■■ 已修改文件
ZigbeeApp/Shared/Common/CommonPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/Device.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/Method.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs 196 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs 190 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/ZigBee/Device/Enum.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/R.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/CommonPage.cs
@@ -50,7 +50,7 @@
        /// <summary>
        /// 版本号
        /// </summary>
        public static string CodeIDString = "1.0.20051301";
        public static string CodeIDString = "1.0.20051801";
        /// <summary>
        /// 注册来源(0:HDL On 1:Zigbee)
        /// </summary>
ZigbeeApp/Shared/Common/Device.cs
@@ -732,7 +732,7 @@
        /// <returns></returns>
        public bool DeviceIsCanFixedPosition(CommonDevice device)
        {
            if (device.Type == DeviceType.DoorLock)
            if (device.Type == DeviceType.DoorLock || device.Type == DeviceType.PMSensor)
            {
                //门锁没有定位功能
                return false;
@@ -1982,6 +1982,16 @@
                    this.dicDeviceRoomId[listDevice[0].DeviceAddr] = roomId;
                    save = true;
                }
                else
                {
                    //2020.05.18追加:如果记录的房间ID是不存在的话,则重新覆盖
                    var room = HdlRoomLogic.Current.GetRoomById(this.dicDeviceRoomId[listDevice[0].DeviceAddr]);
                    if (room == null)
                    {
                        this.dicDeviceRoomId[listDevice[0].DeviceAddr] = roomId;
                        save = true;
                    }
                }
            }
            if (save == true)
@@ -2063,6 +2073,25 @@
            HdlAutoBackupLogic.AddOrEditorFile(DirNameResourse.DeviceRoomIdFile);
        }
        /// <summary>
        /// 根据房间ID,移除指定的真实物理设备的所属房间记录
        /// </summary>
        /// <param name="i_RoomId"></param>
        public void DeleteRealDeviceByRoomId(string i_RoomId)
        {
            var listDeleteKey = new List<string>();
            foreach (var deviceAddr in this.dicDeviceRoomId.Keys)
            {
                if (this.dicDeviceRoomId[deviceAddr] == i_RoomId
                    && listDeleteKey.Contains(deviceAddr) == false)
                {
                    listDeleteKey.Add(deviceAddr);
                }
            }
            //将真实物理设备从房间中移除
            this.DeleteRealDeviceFromRoom(listDeleteKey);
        }
        #endregion
        #region ■ 设备排序___________________________
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
@@ -98,22 +98,20 @@
                        {
                            continue;
                        }
                        Common.Logic.LockLogicList.Add(listlogic[j]);
                        Common.Logic.LockLogicList.Add(logic);
                        //bool yes = false;
                        //for (int a = 0; a < logic.Accounts.Count; a++)
                        //{
                        //    //Option4是设备mac;Option2是设备端口;
                        //    if (logic.Accounts[a]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[a]["Option2"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString())
                        //    if (logic.Accounts[a]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr)
                        //    {
                        //        //查找是否是那个门锁;
                        //        //如果不是该门锁联动事件不显示出来;
                        //        yes = false;
                        //    }
                        //    else
                        //    {
                        //        yes = true;
                        //    }
                        //    //if (logic.Accounts[a]["Account"].ToString() == Config.Instance.Guid)
                        //    //{
@@ -320,29 +318,17 @@
        /// <returns></returns>
        private bool Exist(Common.Logic logic)
        {
            bool yes = false;
            for (int j = 0; j < logic.Accounts.Count; j++)
            {
                //Option4是设备mac;Option2是设备端口;
                if (logic.Accounts[j]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[j]["Option2"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString())
                if (logic.Accounts[j]["Option4"].ToString() == Send.CurrentDoorLock.DeviceAddr)
                {
                    //查找是否是那个门锁;
                    //如果不是该门锁联动事件不显示出来;
                    yes = false;
                    return true;
                }
                else
                {
                    yes = true;
                }
                //if (logic.Accounts[j]["Account"].ToString() == Config.Instance.Guid)
                //{
                //    //查找自己账号下的创建联动事件;
                //    yes = true;
                //    break;
                //}
            }
            return yes;
            return false;
        }
    }
}
ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
@@ -833,7 +833,7 @@
                        }
                        if (LogicView.IfString._SoneLogic == if_logic)
                        {
                            //Sone门锁联动事件逻辑列表
                            //Sone门锁常开模式逻辑列表
                            Common.Logic.SoneLogicList.Add(CurrentLogic);
                        }
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
old mode 100644 new mode 100755
@@ -22,6 +22,7 @@
            return await System.Threading.Tasks.Task.Run(async () =>
            {
                List<int> logicIdList = new List<int>();
                Action<string, string> action = (topic, data) =>
                {
                    var gatewayID = topic.Split('/')[0];
@@ -30,7 +31,7 @@
                    {
                        return;
                    }
                    if (topic == $"{gatewayID}/Logic/GetLogicList_Respon")
                    {
@@ -43,6 +44,7 @@
                        {
                            var logicId = int.Parse(listIfon["LogicId"].ToString());
                            logicIdList.Add(logicId);
                        }
                    }
@@ -529,6 +531,10 @@
                            case 8:
                                {
                                    var accounts1 = new JObject();
                                    if (dictionary.ContainsKey("Type"))
                                    {
                                        accounts1.Add("Type", dictionary["Type"]);
                                    }
                                    if (dictionary.ContainsKey("Option4"))
                                    {
                                        accounts1.Add("Option4", dictionary["Option4"]);
@@ -540,7 +546,6 @@
                                    accounts.Add(accounts1);
                                }
                                break;
                        }
                    }
ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
old mode 100644 new mode 100755
@@ -717,11 +717,12 @@
            timeConditionsInfo.Add("DelayTime", "0");
            timeConditionsInfo.Add("StartHour", h);
            timeConditionsInfo.Add("StartMin", m);
            timeConditionsInfo.Add("DoorLockOpenDelayTime", timeVlaue.ToString());
            timeConditionsInfo.Add("DoorLockOpenDelayTime", (timeVlaue*60*60).ToString());
            //timeConditionsInfo.Add("DoorLockOpenDelayTime", (timeVlaue * 3600).ToString());
            Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
            actionsInfo.Add("LinkType", 8);
            actionsInfo.Add("DeviceAddr", common.DeviceAddr);
            actionsInfo.Add("Epoint", common.DeviceEpoint);
            actionsInfo.Add("Epoint", "200");
            actionsInfo.Add("PassData", "055704010113");//默认门锁常关
            Dictionary<string, string> accounts = new Dictionary<string, string>();
@@ -841,22 +842,18 @@
        /// <returns></returns>
        public static bool ExistLogic(Common.Logic logic, ZigBee.Device.DoorLock doorLock)
        {
            bool yes = false;
            for (int j = 0; j < logic.Accounts.Count; j++)
            {
                //Option4是设备mac;Option2是设备端口;
                if (logic.Accounts[j]["Option4"].ToString() != doorLock.DeviceAddr && logic.Accounts[j]["Option2"].ToString() != doorLock.DeviceEpoint.ToString())
                if (logic.Accounts[j]["Option4"].ToString() == doorLock.DeviceAddr)
                {
                    //查找是否是那个门锁;
                    //如果不是该门锁联动事件不显示出来;
                    yes = false;
                    return true;
                }
                else
                {
                    yes = true;
                }
            }
            return yes;
            return false;
        }
    }
ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs
old mode 100644 new mode 100755
@@ -16,7 +16,7 @@
        }
        /// 给徐梅刷新界面用的
        public  Action<bool> action;
        public Action<bool> action;
        ///第二块第一级父控件
        FrameLayout fLayout = new FrameLayout();
        ///第三块第一级父控件
@@ -31,9 +31,17 @@
        /// 记录选中时间
        /// </summary>
        public int timeValue = 0;
        /// <summary>
        /// 标记显示执行日期(用网关的,还是用系统的时间)
        /// </summary>
        public bool _if = false;
        /// <summary>
        /// 时间戳
        /// </summary>
        public int timeLong = 0;
        public async void Show()
        {
            #region  界面的布局代码
            UserView.HomePage.Instance.ScrollEnabled = false;//锁住左滑
            TopView view = new TopView();
@@ -60,11 +68,12 @@
            this.AddChidren(middle);
            #endregion
            //是常开模式再去读取
            if (Send.CurrentDoorLock.IsDoorLockNormallyMode)
            {
                //进来更新一次
                //查找是否存在时效性自动化;有的话就返回自动化对象;
              var  logic = await SkipView.GetLogicIfon(Send.CurrentDoorLock);
                var logic = await SkipView.GetLogicIfon(Send.CurrentDoorLock);
                if (logic != null)
                {
                    try
@@ -72,6 +81,8 @@
                        //进来更新一次值
                        logicId = logic.LogicId;
                        timeValue = int.Parse(logic.Conditions[0]["DoorLockOpenDelayTime"]);
                        timeLong = int.Parse(logic.Conditions[0]["TriggerTime"]);
                    }
                    catch { }
                }
@@ -86,7 +97,6 @@
                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
            };
            middle.AddChidren(fLayout);
            ModeView();
            #endregion
            #region 常开自动化
            ///第三块第一级父控件
@@ -100,7 +110,7 @@
            };
            middle.AddChidren(listLogicFl);
            listLogicFl.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
            ModeView();
            ///添加常开自动化的父控件
            var addLogicfL = new FrameLayout
            {
@@ -163,8 +173,8 @@
                actionsInfo.Add("DeviceAddr", Send.CurrentDoorLock.DeviceAddr);
                actionsInfo.Add("Epoint", "200");
                actionsInfo.Add("PassData", "055704010113");//默认门锁常关
                Dictionary<string, string> accounts = new Dictionary<string, string>();
                accounts.Add("Type", "8");
                Dictionary<string, string> accounts = new Dictionary<string, string>();
                accounts.Add("Type", "8");
                accounts.Add("Option4", Send.CurrentDoorLock.DeviceAddr.ToString());//用于判断识别是哪个门锁;
                accounts.Add("Option2", Send.CurrentDoorLock.DeviceEpoint.ToString());
                //new一个新逻辑对象;
@@ -220,7 +230,7 @@
        /// <summary>
        /// 常开模式开关切换图标界面
        /// </summary>
        public  void ModeView()
        public void ModeView()
        {
            fLayout.RemoveAll();
@@ -274,6 +284,7 @@
                                Send.DelLogic(logicId);
                            }
                            Send.CurrentDoorLock.IsDoorLockNormallyMode = false;
                            _if = false;
                            ModeView();
                        }
                        else
@@ -296,8 +307,8 @@
                var timeTextBtn = new Button
                {
                    Y = Application.GetRealHeight(127 + 69),
                    X = Application.GetRealWidth(125),
                    Width = Application.GetRealWidth(634 + 200),
                    X = Application.GetRealWidth(86),//125
                    Width = Application.GetRealWidth(907),//634 + 200
                    Height = Application.GetRealHeight(60),
                    TextSize = 15,
                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
@@ -305,20 +316,40 @@
                if (logicId != 0)
                {
                    openModeFl.AddChidren(timeTextBtn);
                    ///有时效性常开才显示时间条件文本
                    var y = DateTime.Now.Year.ToString();//那一年
                    var m = DateTime.Now.Month.ToString();//那一月
                    var d = DateTime.Now.ToString("dd");//那一天
                    var h = int.Parse(DateTime.Now.ToString("HH"));//当前系统时间
                    int dayInt = (h + timeValue) / 24;//算出几天后执行
                    int hour = (h + timeValue) % 24;//算出几天后那个时间执行
                    int days = int.Parse(d) + dayInt;
                    string text1 = Language.StringByID(MyInternationalizationString.timeSensitive);
                    string text2 = Language.StringByID(MyInternationalizationString.yearSone);
                    string text3 = Language.StringByID(MyInternationalizationString.monthSone);
                    string text4 = Language.StringByID(MyInternationalizationString.numberSone);
                    string text5 = Language.StringByID(MyInternationalizationString.executeSone);
                    timeTextBtn.Text = text1 + y + text2 + m + text3 + days.ToString() + text4 + hour.ToString() + text5;
                    string text5 = Language.StringByID(MyInternationalizationString.hour1);
                    string text6 = Language.StringByID(MyInternationalizationString.executeSone);
                    if (_if)
                    {
                        ///第一次进来读取网关时间;
                        var datetime = GetLocalTime(timeLong);
                        ///有时效性常开才显示时间条件文本
                        var y = datetime.Year.ToString();//那一年
                        var m = datetime.Month.ToString();//那一月
                        var d = datetime.ToString("dd");//那一天
                        var h = int.Parse(datetime.ToString("HH"));//小时
                        int minute = datetime.Minute;//分钟
                        timeTextBtn.Text = text1 + y + text2 + m + text3 + d + text4 + h + text5 + minute.ToString() + text6;
                    }
                    else
                    {
                        ///有时效性常开才显示时间条件文本
                        var y = DateTime.Now.Year.ToString();//那一年
                        var m = DateTime.Now.Month.ToString();//那一月
                        var d = DateTime.Now.ToString("dd");//那一天
                        var h = int.Parse(DateTime.Now.ToString("HH"));//小时
                        int dayInt = (h + timeValue) / 24;//算出几天后执行
                        int hour = (h + timeValue) % 24;//算出几天后那个时间执行
                        int days = int.Parse(d) + dayInt;
                        int minute = DateTime.Now.Minute;//分钟
                        timeTextBtn.Text = text1 + y + text2 + m + text3 + days.ToString() + text4 + hour.ToString() + text5 + minute.ToString() + text6;
                    }
                }
@@ -376,59 +407,59 @@
                 {
                     LogicView.TipView.ShowConfrimTip(() =>
                     {///再次确认
                        LogicView.TipView.ShowInputTip(true, async (str) =>
                         {///确认发送命令
                            CommonPage.Loading.Start();
                             try
                             {
                                ///xm
                                var result = await UserCenter.DoorLock.DoorLockCommonInfo.SetNormallyOpenModeFuncAsync(Send.CurrentDoorLock);
                                 if (!result)
                                 {
                                     LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.openFailed));
                                     return;
                                 }
                                 else
                                 {
                                    ///因为有常开模式下才可以创建失效逻辑;
                                    SkipView.GetLogicAll(Send.CurrentDoorLock);//删除之前所有失效逻辑
                                    var addResult = await SkipView.LockAddModifyLogic(int.Parse(str), Send.CurrentDoorLock);//添加一条失效逻辑
                                    if (addResult == 0)
                                     {
                                        ///可欣说如果常开模式开,创建自动化失败,那么将要发一条常开模式关闭命令;
                                        UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock);
                                        ///提示失败
                                        LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.addFailed));
                                         return;
                                     }
                                     else
                                     {
                                         logicId = addResult;
                                         timeValue = int.Parse(str);
                                         Send.CurrentDoorLock.IsDoorLockNormallyMode = true;
                                         ModeView();
                                         ///添加APP开启常开模式的历史记录
                                         UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(Send.CurrentDoorLock,9001,string.Empty);
                                     }
                         LogicView.TipView.ShowInputTip(true, async (str) =>
                          {///确认发送命令
                              CommonPage.Loading.Start();
                              try
                              {
                                  ///xm
                                  var result = await UserCenter.DoorLock.DoorLockCommonInfo.SetNormallyOpenModeFuncAsync(Send.CurrentDoorLock);
                                  if (!result)
                                  {
                                      LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.openFailed));
                                      return;
                                  }
                                  else
                                  {
                                      ///因为有常开模式下才可以创建失效逻辑;
                                      SkipView.GetLogicAll(Send.CurrentDoorLock);//删除之前所有失效逻辑
                                      var addResult = await SkipView.LockAddModifyLogic(int.Parse(str), Send.CurrentDoorLock);//添加一条失效逻辑
                                      if (addResult == 0)
                                      {
                                          ///可欣说如果常开模式开,创建自动化失败,那么将要发一条常开模式关闭命令;
                                          UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock);
                                          ///提示失败
                                          LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.addFailed));
                                          return;
                                      }
                                      else
                                      {
                                          logicId = addResult;
                                          timeValue = int.Parse(str);
                                          Send.CurrentDoorLock.IsDoorLockNormallyMode = true;
                                          _if = false;
                                          ModeView();
                                          ///添加APP开启常开模式的历史记录
                                          UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(Send.CurrentDoorLock, 9001, string.Empty);
                                      }
                                 }
                             }
                             catch
                             {
                                  }
                              }
                              catch
                              {
                             }
                             finally
                             {
                                 Application.RunOnMainThread(() =>
                                 {
                                     CommonPage.Loading.Hide();
                              }
                              finally
                              {
                                  Application.RunOnMainThread(() =>
                                  {
                                      CommonPage.Loading.Hide();
                                 });
                             }
                         });
                                  });
                              }
                          });
                     });
@@ -439,12 +470,17 @@
            listLogicFl.Height = Application.GetRealHeight(Method.H - 184) - fLayout.Height;
            listLogicFl.Width = Application.GetRealWidth(1022);
            listLogicFl.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
            verticalRefresh.Y = Application.GetRealHeight(187);
            verticalRefresh.X = Application.GetRealWidth(46);
            verticalRefresh.Height = listLogicFl.Height - Application.GetRealHeight(187);//动态改动上下滑动view高度;
            verticalRefresh.Width = listLogicFl.Width - Application.GetRealWidth(46);
        }
        /// <summary>
        /// 读取自动化列表数据;
        /// </summary>
        /// <param name="yes"></param>
        private async void Read( bool yes)
        private async void Read(bool yes)
        {
            if (yes)
            {
@@ -465,7 +501,7 @@
                            {
                                continue;
                            }
                            if (SkipView.ExistLogic(logic,Send.CurrentDoorLock))
                            if (SkipView.ExistLogic(logic, Send.CurrentDoorLock))
                            {
                                Common.Logic.SoneLogicList.Add(logic);
                            }
@@ -498,6 +534,10 @@
            verticalRefresh.RemoveAll();
            foreach (var logic in Common.Logic.SoneLogicList)
            {
                if (!SkipView.ExistLogic(logic, Send.CurrentDoorLock))
                {
                    continue;
                }
                #region  自动化布局View
                ///自动化父控件
                var fLayoutLogic = new FrameLayout
@@ -588,7 +628,7 @@
                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
                };
                logicRow.AddRightView(edit);
                ///删除
                var del = new Button
                {
@@ -621,6 +661,7 @@
                    else
                    {
                        //逻辑关
                        logic.IsEnable = 0;
                        typeIconBtn.UnSelectedImagePath = "ZigeeLogic/nofunction.png";
                        typeBjBtn.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
                    }
@@ -654,6 +695,17 @@
                };
            }
        }
        /// <summary>
        /// 将UNIX时间戳转换成系统时间(精确到秒)
        /// <returns></returns>
        public DateTime GetLocalTime(int unixTimeStamp)
        {
            DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
            long lTime = long.Parse(unixTimeStamp + "0000000");
            TimeSpan toNow = new TimeSpan(lTime);
            DateTime dtResult = dtStart.Add(toNow);
            return dtResult;
        }
    }
}
ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs
@@ -400,6 +400,15 @@
        }
        /// <summary>
        /// 设置PM2.5传感器状态文本(不需要指定【当前两个字】)
        /// </summary>
        /// <param name="text"></param>
        public void SetPmTwoPointFiveStatuText(string text)
        {
            this.btnStatu.Text = text;
        }
        /// <summary>
        /// 重新设置设备名字控件和状态控件的Y轴
        /// </summary>
        /// <param name="i_NameY">设备名字控件的Y轴(真实值)</param>
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs
@@ -11,7 +11,7 @@
    /// </summary>
    public class DevicePmSensorDetailCardForm : DeviceDetailCardCommonForm
    {
        #region ■ 变量声明___________________________
        #region ■ 变量声明___________________________
        /// <summary>
        /// 界面上可以操作的控件
        /// </summary>
@@ -44,7 +44,7 @@
            this.pMSensor = (PMSensor)this.device;
            //先清空
            this.listControl = new List<ButtonBase>();
            InitFreshAirControl(frameWhiteBack);
            InitPmControl(frameWhiteBack);
            UpdateStatus();
        }
@@ -52,7 +52,7 @@
        /// 初始化PM2.5传感器控件
        /// </summary>
        /// <param name="frameWhiteBack"></param>
        private void InitFreshAirControl(FrameLayout frameWhiteBack)
        private void InitPmControl(FrameLayout frameWhiteBack)
        {
            //湿度容器
            var frameHumidityPic = new FrameLayout();
@@ -76,7 +76,7 @@
            var btnHumidityStatus = new NormalViewControl(193, 92, true);
            btnHumidityStatus.Y = Application.GetRealHeight(181);
            btnHumidityStatus.Text = "20";
            btnHumidityStatus.TextSize = 32;
            btnHumidityStatus.TextSize = 30;
            btnHumidityStatus.TextColor = ZigbeeColor.Current.XMWhite;
            btnHumidityStatus.TextAlignment = TextAlignment.CenterRight;
            frameHumidityPic.AddChidren(btnHumidityStatus);
@@ -85,7 +85,7 @@
            //湿度单位
            var btnHumidityUnit = new NormalViewControl(37 + 81, 40, true);
            btnHumidityUnit.Y = Application.GetRealHeight(181 + 46);
            btnHumidityUnit.X = Application.GetRealWidth(190);
            btnHumidityUnit.X = Application.GetRealWidth(180);
            btnHumidityUnit.Text = "%";
            btnHumidityUnit.TextSize = 14;
            btnHumidityUnit.TextColor = ZigbeeColor.Current.XMWhite;
@@ -113,7 +113,7 @@
            var btnTemperatureStatus = new NormalViewControl(193, 92, true);
            btnTemperatureStatus.Y = Application.GetRealHeight(181);
            btnTemperatureStatus.Text = "20";
            btnTemperatureStatus.TextSize = 32;
            btnTemperatureStatus.TextSize = 30;
            btnTemperatureStatus.TextColor = ZigbeeColor.Current.XMWhite;
            btnTemperatureStatus.TextAlignment = TextAlignment.CenterRight;
            frameTemperaturePic.AddChidren(btnTemperatureStatus);
@@ -122,7 +122,7 @@
            //温度单位
            var btnTemperatureUnit = new NormalViewControl(40 + 81, 40, true);
            btnTemperatureUnit.Y = Application.GetRealHeight(181 + 46);
            btnTemperatureUnit.X = Application.GetRealWidth(188);
            btnTemperatureUnit.X = Application.GetRealWidth(180);
            btnTemperatureUnit.Text = "℃";
            btnTemperatureUnit.TextSize = 14;
            btnTemperatureUnit.TextColor = ZigbeeColor.Current.XMWhite;
@@ -147,26 +147,27 @@
            framePmPic.AddChidren(btnPmText);
            //PM2.5数据(第3个,listControl【2】)
            var btnPmStatus = new NormalViewControl(109 + 40, 92, true);
            var btnPmStatus = new NormalViewControl(162, 92, true);
            btnPmStatus.Y = Application.GetRealHeight(181);
            btnPmStatus.Text = "35";
            btnPmStatus.TextSize = 32;
            btnPmStatus.Text = "155";
            btnPmStatus.TextSize = 30;
            btnPmStatus.TextColor = ZigbeeColor.Current.XMWhite;
            btnPmStatus.TextAlignment = TextAlignment.CenterRight;
            framePmPic.AddChidren(btnPmStatus);
            this.listControl.Add(btnPmStatus);
            //PM2.5单位
            var btnPmUnit = new NormalViewControl(124 + 15, 43, true);
            //PM2.5单位  (第4个,listControl【3】)
            var btnPmUnit = new NormalViewControl(120 + 26, 43, true);
            btnPmUnit.Y = Application.GetRealHeight(181 + 46);
            btnPmUnit.X = Application.GetRealWidth(150);
            btnPmUnit.X = Application.GetRealWidth(153);
            btnPmUnit.Text = "μg/m³";
            btnPmUnit.TextSize = 14;
            btnPmUnit.TextColor = ZigbeeColor.Current.XMWhite;
            btnPmUnit.TextAlignment = TextAlignment.CenterLeft;
            framePmPic.AddChidren(btnPmUnit);
            this.listControl.Add(btnPmUnit);
        }
        #endregion
        #endregion
        #region ■ 是否获取网关反馈的结果_____________
@@ -236,31 +237,6 @@
        }
        #endregion
        #region ■ 设置方法
        /// <summary>
        ///命令
        ///0:Off
        ///1:Low
        ///3:High
        ///4:On
        ///5:Auto
        /// 15:Manual
        /// </summary>
        private void SetFanComand(int command)
        {
            //检测是否获取网关反馈的结果,如果网关没有回复,则会弹出消息
            this.StartCheckResponeResult(this.listControl, (result) =>
            {
                //接收到网关回复
                if (result == true)
                {
                }
            });
        }
        #endregion
        #region ■ 刷新状态_____________
        /// <summary>
        /// 刷新状态
@@ -271,9 +247,85 @@
            this.listControl[0].Text = pMSensor.currentTemperature.ToString();
            this.listControl[1].Text = pMSensor.currentHumidity.ToString();
            this.listControl[2].Text = pMSensor.currentPmData.ToString();
            //设置状态文字
            this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1));
            //设置状态文字
            var curText = Language.StringByID(R.MyInternationalizationString.AirQuality) + QuailityType();
            this.SetStatuText(curText);
        }
        /// <summary>
        /// 质量等级
        /// </summary>
        private string QuailityType()
        {
            string curQuality = string.Empty;
            if (pMSensor.currentPmData <= 35 && pMSensor.currentPmData >= 0)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                if (pMSensor.currentPmData < 10)
                {
                    this.listControl[2].Width = Application.GetRealWidth(188 - 70);
                    this.listControl[3].X = Application.GetRealWidth(180 - 70);
                }
                else
                {
                    this.listControl[2].Width = Application.GetRealWidth(193 - 40);
                    this.listControl[3].X = Application.GetRealWidth(137);
                }
            }
            else if (pMSensor.currentPmData <= 75 && pMSensor.currentPmData > 35)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                this.listControl[2].Width = Application.GetRealWidth(193 - 40);
                this.listControl[3].X = Application.GetRealWidth(137);
            }
            else if (pMSensor.currentPmData <= 115 && pMSensor.currentPmData > 75)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                if (pMSensor.currentPmData < 100)
                {
                    this.listControl[2].Width = Application.GetRealWidth(193 - 40);
                    this.listControl[3].X = Application.GetRealWidth(137);
                }
                else
                {
                    this.listControl[2].Width = Application.GetRealWidth(162);
                    this.listControl[3].X = Application.GetRealWidth(153);
                }
            }
            else if (pMSensor.currentPmData <= 150 && pMSensor.currentPmData > 115)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                this.listControl[2].Width = Application.GetRealWidth(162);
                this.listControl[3].X = Application.GetRealWidth(153);
            }
            else if (pMSensor.currentPmData <= 250 && pMSensor.currentPmData > 150)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                this.listControl[2].Width = Application.GetRealWidth(162);
                this.listControl[3].X = Application.GetRealWidth(153);
            }
            else if (pMSensor.currentPmData > 250)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                this.listControl[2].Width = Application.GetRealWidth(162);
                this.listControl[3].X = Application.GetRealWidth(153);
            }
            else
            {
                curQuality = "";
                this.listControl[2].Width = Application.GetRealWidth(162);
                this.listControl[3].X = Application.GetRealWidth(153);
            }
            //设置状态文字
            return curQuality;
        }
        #endregion
    }
}
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
@@ -286,6 +286,60 @@
        #endregion
        #region ■ PM2.5_______________________________
        /// <summary>
        /// SendPmSensorComand
        /// </summary>
        /// <param name="device">设备</param>
        public void SendPmSensorComand(CommonDevice device)
        {
            if (device == null)
            {
                return;
            }
            new System.Threading.Thread(() =>
            {
                SendPmSensorStatuComand(device);
                //读取Pm2.5传感器的温度数据
                HdlDeviceAttributeLogic.Current.SendTemperatureStatuComand(device);
                //读取Pm2.5传感器的湿度数据
                HdlDeviceAttributeLogic.Current.SendHumidityStatuComand(device);
                System.Threading.Thread.Sleep(300);
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// SendFanStatuComand
        /// </summary>
        /// <param name="device">设备</param>
        private void SendPmSensorStatuComand(CommonDevice device)
        {
            if (device == null)
            {
                return;
            }
            var jObject = new Newtonsoft.Json.Linq.JObject
            {
                { "DeviceAddr",device.DeviceAddr },
                { "Epoint", device.DeviceEpoint },
                { "Cluster_ID", (int)Cluster_ID.PmTwoPointFiveMeasurement  },
                { "Command", 108 }
            };
            var attriBute = new Newtonsoft.Json.Linq.JArray
            {
               new Newtonsoft.Json.Linq.JObject
               {
                 { "AttriButeId", (int)AttriButeId.MeasuredValue}
               }
            };
            var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
            jObject.Add("Data", data);
            device.Gateway?.Send("GetDeviceStatus", jObject.ToString());
        }
        #endregion
        #region ■ 窗帘_______________________________
        /// <summary>
        /// 发送获取窗帘状态命令
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs
@@ -183,6 +183,57 @@
                }
                return $"{wind}";
            }
            else if (device.Type == DeviceType.PMSensor)
            {
                //在网关没有回复之前,默认离线
                if (device.HadReadDeviceStatu == false)
                {
                    return Language.StringByID(R.MyInternationalizationString.uOffLine);
                }
                //空气质量
                string curQuality = "";
                //温度
                string temperature = string.Empty;
                //湿度
                string humidity = string.Empty;
                //PM2.5
                string pm = string.Empty;
                var pMSensor = device as PMSensor;
                if (pMSensor.currentPmData <= 35 && pMSensor.currentPmData >= 0)
                {
                    curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                }
                else if (pMSensor.currentPmData <= 75 && pMSensor.currentPmData > 35)
                {
                    curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                }
                else if (pMSensor.currentPmData <= 115 && pMSensor.currentPmData > 75)
                {
                    curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                }
                else if (pMSensor.currentPmData <= 150 && pMSensor.currentPmData > 115)
                {
                    curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                }
                else if (pMSensor.currentPmData <= 250 && pMSensor.currentPmData > 150)
                {
                    curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                }
                else if (pMSensor.currentPmData > 250)
                {
                    curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                }
                else
                {
                    curQuality = "--";
                }
                humidity = $"{pMSensor.currentHumidity}%";
                temperature = $"{pMSensor.currentTemperature}℃";
                pm = $"{pMSensor.currentPmData}μg/m³";
                return $"{curQuality},{pm},{temperature},{humidity}";
            }
            else if (device.Type == DeviceType.Thermostat)
            {
                //在网关没有回复之前,默认离线
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
@@ -526,6 +526,28 @@
                    }
                }
                #endregion
                #region ■ PM2.5数据
                //PM2.5数据
                else if (report.DeviceStatusReport.CluterID == 1066)
                {
                    foreach (var attData in report.DeviceStatusReport.AttriBute)
                    {
                        //PM2.5
                        if (attData.AttributeId == (int)AttriButeId.MeasuredValue)
                        {
                            if (attData.AttriButeDataType == 57)
                            {
                                ((PMSensor)locadevice).currentPmData = attData.AttriButeData;
                            }
                        }
                        //已经接收到状态
                        locadevice.HadReadDeviceStatu = true;
                    }
                }
                #endregion
            }
            this.DeviceReportPush(report, ReceiveComandDiv.A设备属性上报);
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs
@@ -290,6 +290,10 @@
                Global.DeleteFilebyHomeId(roomFilePath);
            }
            HdlAutoBackupLogic.DeleteFile(roomFilePath);
            //根据房间ID,移除指定的真实物理设备的所属房间记录
            Common.LocalDevice.Current.DeleteRealDeviceByRoomId(roomId);
            //刷新房间视图列表
            this.RefreshRoomListView();
        }
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs
@@ -684,13 +684,14 @@
        /// <returns></returns>
        public string GetZoneById(int sceneId)
        {
            var room =HdlRoomLogic.Current.GetRoomBySceneId(sceneId);
            var room = HdlRoomLogic.Current.GetRoomBySceneId(sceneId);
            if (room == null)
            {
                return null;
            }
            var floorName = Shared.Common.Config.Instance.Home.GetFloorNameById(room.FloorId);
            if (floorName == null)
            //更改代码:如果floorName=“”也要判断,否则有“,”
            if (string.IsNullOrEmpty(floorName))
            {
                return room.Name;
            }
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
@@ -354,10 +354,12 @@
                    continue;
                }
                roomTempList.Add(room);
                if (roomTempList.Count != 0)
                {
                    curRoom = roomTempList[0];
                }
            }
            for (int i = 0; i < roomTempList.Count; i++)
            {
                var room = roomTempList[i];
                curRoom = roomTempList[0];
                var btnRoomFrameLayout = new FrameLayout
                {
@@ -391,6 +393,18 @@
                    curentOldRoom = btnRoom;
                    curentOldRoomFrameLayout = btnRoomFrameLayout;
                }
                if (index == roomTempList.Count - 1 && index > 3)
                {
                    var btnRoomFrameLayoutEmpty = new FrameLayout
                    {
                        Height = Application.GetMinReal(159),
                        Width = Application.GetMinReal(50),
                        Y = Application.GetRealHeight(23),
                        X = Application.GetRealWidth(5),
                        BorderWidth = 1,
                    };
                    btnHorizontalScrolViewLayout.AddChidren(btnRoomFrameLayoutEmpty);
                }
                EventHandler<MouseEventArgs> eHandlerRoom = (sender, e) =>
                {
                    if (!btnRoom.IsSelected)
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -490,11 +490,11 @@
                {
                    roomTempList.Add(room);
                }
                if (roomTempList.Count != 0)
                {
                    curRoom = roomTempList[0];
                }
            }
            for (int i = 0; i < roomTempList.Count; i++)
            {
                var room = roomTempList[i];
                curRoom = roomTempList[0];
                var btnRoomFrameLayout = new FrameLayout
                {
                    Height = Application.GetMinReal(159),
@@ -527,6 +527,20 @@
                    curentOldRoom = btnRoom;
                    curentOldRoomFrameLayout = btnRoomFrameLayout;
                }
                if (index == roomTempList.Count - 1 && index > 3)
                {
                    var btnRoomFrameLayoutEmpty = new FrameLayout
                    {
                        Height = Application.GetMinReal(159),
                        Width = Application.GetMinReal(50),
                        Y = Application.GetRealHeight(23),
                        X = Application.GetRealWidth(5),
                        BorderWidth = 1,
                    };
                    btnHorizontalScrolViewLayout.AddChidren(btnRoomFrameLayoutEmpty);
                }
                EventHandler<MouseEventArgs> eHandlerRoom = (sender, e) =>
                {
                    if (!btnRoom.IsSelected)
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
@@ -739,21 +739,27 @@
            if (typeModeList == null)
            {
                //再次动态获取按键支持的大类
                CommonPage.Loading.Start();
                Application.RunOnMainThread(() =>
                {
                    CommonPage.Loading.Start();
                });
                typeModeList = await GetTypeMode();
                if (typeModeList == null)
                {
                    Application.RunOnMainThread(() =>
                    {
                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                        CommonPage.Loading.Hide();
                    });
                    CommonPage.Loading.Hide();
                    dialog.Close();
                    return;
                }
                else
                {
                    CommonPage.Loading.Hide();
                    Application.RunOnMainThread(() =>
                    {
                        CommonPage.Loading.Hide();
                    });
                }
            }
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs
@@ -350,22 +350,46 @@
            frameColor.ButtonClickEvent += (sender, e) =>
            {
                var form = new PanelColorSelectForm();
                form.AddForm(R1, G1, B1);
                form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
                {
                    R1 = Rcolor;
                    G1 = Gcolor;
                    B1 = Bcolor;
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnColorView.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnColor.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnColorLine.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnRight.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
        }
                    this.keyColorData.CloseColorR = Convert.ToString(Rcolor, 16);
                    this.keyColorData.CloseColorG = Convert.ToString(Gcolor, 16);
                    this.keyColorData.CloseColorB = Convert.ToString(Bcolor, 16);
        /// <summary>
        /// PanelColorBefore
        /// </summary>
        private void PanelColor(NormalViewControl btnColor, SeekBarControl seekBar1, int R1, int G1, int B1)
        {
            var form = new PanelColorSelectForm();
            form.AddForm(R1, G1, B1);
            form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
            {
                R1 = Rcolor;
                G1 = Gcolor;
                B1 = Bcolor;
                    btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
                    //变更滑动条的颜色
                    seekBar1.ProgressBarColor = btnColor.BackgroundColor;
                };
                this.keyColorData.CloseColorR = Convert.ToString(Rcolor, 16);
                this.keyColorData.CloseColorG = Convert.ToString(Gcolor, 16);
                this.keyColorData.CloseColorB = Convert.ToString(Bcolor, 16);
                btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
                //变更滑动条的颜色
                seekBar1.ProgressBarColor = btnColor.BackgroundColor;
            };
        }
@@ -488,25 +512,25 @@
            frameColor.ButtonClickEvent += (sender, e) =>
            {
                var form = new PanelColorSelectForm();
                form.AddForm(R1, G1, B1);
                form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
                {
                    R1 = Rcolor;
                    G1 = Gcolor;
                    B1 = Bcolor;
                    this.keyColorData.OpenColorR = Convert.ToString(Rcolor, 16);
                    this.keyColorData.OpenColorG = Convert.ToString(Gcolor, 16);
                    this.keyColorData.OpenColorB = Convert.ToString(Bcolor, 16);
                    btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
                    //变更滑动条的颜色
                    seekBar1.ProgressBarColor = btnColor.BackgroundColor;
                };
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnColorView.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnColor.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnColorLine.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnRight.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
        }
        #endregion
        #region ■ 获取初始数据_______________________
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
@@ -53,6 +53,10 @@
        /// 被绑目标是PM2.5
        /// </summary>
        private CommonDevice bindPMDev;
        // <summary>
        /// 按键中被绑定的目标列表
        /// </summary>
        public List<BindObj.BindListResponseObj> bindList = new List<BindObj.BindListResponseObj>();
        #endregion
@@ -241,9 +245,9 @@
            var panelBindListRes = await curControlDev.GetDeviceBindAsync();
            if (panelBindListRes != null && panelBindListRes.getAllBindResponseData != null)
            {
                foreach (var bDev in panelBindListRes.getAllBindResponseData.BindList)
                bindList = panelBindListRes.getAllBindResponseData.BindList;
                foreach (var bDev in bindList)
                {
                    curControlDev.bindList.Add(bDev);
                    var device = Common.LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint);
                    if (device.Type == DeviceType.FreshAir)
@@ -255,7 +259,15 @@
                        {
                            continue;
                        }
                        bindFreshAirName = device.DeviceEpointName;
                        if (string.IsNullOrEmpty(bDev.ESName))
                        {
                            bindFreshAirName = device.DeviceEpointName;
                        }
                        else
                        {
                            bindFreshAirName = bDev.ESName;
                        }
                        bindFreshAirDev = device;
                    }
                    if (device.Type == DeviceType.TemperatureSensor)
@@ -263,24 +275,68 @@
                        var bD = device as TemperatureSensor;
                        if (bD.SensorDiv == 1)
                        {
                            bindTemperatureName = device.DeviceEpointName;
                            if (string.IsNullOrEmpty(bDev.ESName))
                            {
                                bindTemperatureName = device.DeviceEpointName;
                            }
                            else
                            {
                                bindTemperatureName = bDev.ESName;
                            }
                            bindTemperatureDev = device;
                        }
                        if (bD.SensorDiv == 2)
                        {
                            bindHumidityName = device.DeviceEpointName;
                            if (string.IsNullOrEmpty(bDev.ESName))
                            {
                                bindHumidityName = device.DeviceEpointName;
                            }
                            else
                            {
                                bindHumidityName = bDev.ESName;
                            }
                            bindHumidityDev = device;
                        }
                    }
                    if (device.Type == DeviceType.FreshAirHumiditySensor)
                    {
                        bindHumidityName = device.DeviceEpointName;
                        if (string.IsNullOrEmpty(bDev.ESName))
                        {
                            bindHumidityName = device.DeviceEpointName;
                        }
                        else
                        {
                            bindHumidityName = bDev.ESName;
                        }
                        bindHumidityDev = device;
                    }
                    if (device.Type == DeviceType.PMSensor)
                    {
                        bindPmName = device.DeviceEpointName;
                        bindPMDev = device;
                        if (bDev.BindCluster == 1026)
                        {
                            bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
                            bindTemperatureDev = device;
                        }
                        if (bDev.BindCluster == 1029)
                        {
                            bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
                            bindHumidityDev = device;
                        }
                        if (bDev.BindCluster == 1066)
                        {
                            if (string.IsNullOrEmpty(bDev.ESName))
                            {
                                bindPmName = device.DeviceEpointName;
                            }
                            else
                            {
                                bindPmName = bDev.ESName;
                            }
                            bindPMDev = device;
                        }
                    }
                }
                result = true;
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs
@@ -103,10 +103,7 @@
        /// PM绑定目标回调
        /// </summary>
        public Action<string> actionPMTarget = null;
        /// <summary>
        /// 是否能点击保存按钮
        /// </summary>
        private bool canSave = true;
        #endregion
        #region UI设计 
@@ -337,6 +334,19 @@
                    }
                }
                if (index == roomTempList.Count - 1 && index > 3)
                {
                    var btnRoomFrameLayoutEmpty = new FrameLayout
                    {
                        Height = Application.GetMinReal(159),
                        Width = Application.GetMinReal(50),
                        Y = Application.GetRealHeight(23),
                        X = Application.GetRealWidth(5),
                        BorderWidth = 1,
                    };
                    btnHorizontalScrolViewLayout.AddChidren(btnRoomFrameLayoutEmpty);
                }
                EventHandler<MouseEventArgs> eHandlerRoom = (sender, e) =>
                {
                    if (!btnRoom.IsSelected)
@@ -475,12 +485,20 @@
                        break;
                    case 2:
                        devicePic.UnSelectedImagePath = "Device/SensorTemperature.png";
                        if (device.Type == DeviceType.PMSensor)
                        {
                            btnBindName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
                        }
                        break;
                    case 3:
                        devicePic.UnSelectedImagePath = "Device/SensorHumidity.png";
                        if (device.Type == DeviceType.PMSensor)
                        {
                            btnBindName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
                        }
                        break;
                    case 4:
                        devicePic.UnSelectedImagePath = "Device/FreshAirEpoint.png";
                        devicePic.UnSelectedImagePath = "Device/AirQualitySensorEpoint.png";
                        break;
                }
                #endregion
@@ -709,7 +727,7 @@
                    //获取所有房间中匹配的能绑的目标
                    currentPanelSupportBindDeviceList = GetAllRoomSupportDeviceList();
                    //获取面板中存在的绑定目标
                    //获取面板中存在的绑定目标
                    var panelBindListRes = await this.curControlDev.GetDeviceBindAsync();
                    if (panelBindListRes != null && panelBindListRes.getAllBindResponseData != null)
                    {
@@ -728,17 +746,18 @@
                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                        });
                    }
                    targetList.Clear();
                    //选中目标列表 targetList
                    if (currentPanelSupportBindDeviceList.Count != 0 && curControlDev.bindList.Count != 0)
                    {
                        foreach (var bindDev in currentPanelSupportBindDeviceList)
                        foreach (var bindDev in curControlDev.bindList)
                        {
                            var mainKey = bindDev.DeviceAddr + bindDev.DeviceEpoint;
                            var dev = curControlDev.bindList.Find(obj => (obj != null) && (obj.BindMacAddr + obj.BindEpoint == mainKey));
                            var mainKey = bindDev.BindMacAddr + bindDev.BindEpoint;
                            var dev = currentPanelSupportBindDeviceList.Find(obj => (obj != null) && (obj.DeviceAddr + obj.DeviceEpoint == mainKey));
                            if (dev != null)
                            {
                                var device = LocalDevice.Current.GetDevice(bindDev.DeviceAddr, bindDev.DeviceEpoint);
                                var device = LocalDevice.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint);
                                if (device != null)
                                {
                                    switch (curDeviceBindType)
@@ -767,6 +786,14 @@
                                                    oldTargetList.Add(device);
                                                }
                                            }
                                            if (device.Type == DeviceType.PMSensor)
                                            {
                                                if (bindDev.BindCluster == 1026)
                                                {
                                                    targetList.Add(device);
                                                    oldTargetList.Add(device);
                                                }
                                            }
                                            break;
                                        case 3:
                                            if (device.Type == DeviceType.TemperatureSensor)
@@ -783,9 +810,25 @@
                                                targetList.Add(device);
                                                oldTargetList.Add(device);
                                            }
                                            if (device.Type == DeviceType.PMSensor)
                                            {
                                                if (bindDev.BindCluster == 1029)
                                                {
                                                    targetList.Add(device);
                                                    oldTargetList.Add(device);
                                                }
                                            }
                                            break;
                                        case 4:
                                            //PM2.5
                                            if (device.Type == DeviceType.PMSensor)
                                            {
                                                if (bindDev.BindCluster == 1066)
                                                {
                                                    targetList.Add(device);
                                                    oldTargetList.Add(device);
                                                }
                                            }
                                            break;
                                    }
@@ -902,6 +945,7 @@
                                        break;
                                    case 4:
                                        //PM2.5
                                        removeDevice.BindCluster = 1066;
                                        break;
                                }
                                removeDevice.BindMacAddr = bd.DeviceAddr;
@@ -948,6 +992,7 @@
                                            btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                            this.RemoveFromParent();
                                        });
                                    }
                                    else
                                    {
@@ -960,6 +1005,17 @@
                                        });
                                        return;
                                    }
                                }
                                else
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.OperrateFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
                                        btnFinifh.Enable = true;
                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                        CommonPage.Loading.Hide();
                                    });
                                    return;
                                }
                            }
                        }
@@ -1024,6 +1080,17 @@
                                var delDevice = DelBindDevice(bd);
                                var delResult = new DelDeviceBindResponseAllData();
                                delResult = await curControlDev.DelDeviceBindAsync(delDevice);
                                if (delResult == null || delResult.removeBindResultResponseData == null)
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
                                        btnFinifh.Enable = true;
                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                        CommonPage.Loading.Hide();
                                    });
                                    return;
                                }
                                if (delResult != null && delResult.removeBindResultResponseData != null)
                                {
                                    if (delResult.removeBindResultResponseData.Result != 0)
@@ -1049,6 +1116,17 @@
                                var delDevice = DelBindDevice(curBindDevice);
                                var delResult = new DelDeviceBindResponseAllData();
                                delResult = await curControlDev.DelDeviceBindAsync(delDevice);
                                if (delResult == null || delResult.removeBindResultResponseData == null)
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
                                        btnFinifh.Enable = true;
                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                        CommonPage.Loading.Hide();
                                    });
                                    return;
                                }
                                if (delResult != null && delResult.removeBindResultResponseData != null)
                                {
                                    if (delResult.removeBindResultResponseData.Result != 0)
@@ -1087,13 +1165,29 @@
                                    break;
                                case 4:
                                    //PM2.5
                                    addBindInfo.BindCluster = 1066;
                                    break;
                            }
                            addBindInfo.BindType = 0;
                            addBindInfo.BindMacAddr = de.DeviceAddr;
                            addBindInfo.BindEpoint = de.DeviceEpoint;
                            addBindeDev.BindName = de.DeviceEpointName;
                            switch (curDeviceBindType)
                            {
                                case 2:
                                    if (de.Type == DeviceType.PMSensor)
                                    {
                                        addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
                                    }
                                    break;
                                case 3:
                                    if (de.Type == DeviceType.PMSensor)
                                    {
                                        addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor);
                                    }
                                    break;
                            }
                            addBindeDev.BindList.Add(addBindInfo);
                            bindName = de.DeviceEpointName;
                        }
                        var dev = new AddedDeviceBindResponseAllData();
@@ -1113,33 +1207,31 @@
                        {
                            if (dev.addedDeviceBindResponseData.Result == 0)
                            {
                                curControlDev.bindList = dev.addedDeviceBindResponseData.BindList;
                                targetList.Clear();
                                switch (curDeviceBindType)
                                {
                                    case 1:
                                        if (actionFreshAirTarget != null)
                                        {
                                            actionFreshAirTarget(bindName);
                                            actionFreshAirTarget(addBindeDev.BindName);
                                        }
                                        break;
                                    case 2:
                                        if (actionTemperatureTarget != null)
                                        {
                                            actionTemperatureTarget(bindName);
                                            actionTemperatureTarget(addBindeDev.BindName);
                                        }
                                        break;
                                    case 3:
                                        if (actionHumidityTarget != null)
                                        {
                                            actionHumidityTarget(bindName);
                                            actionHumidityTarget(addBindeDev.BindName);
                                        }
                                        break;
                                    case 4:
                                        if (actionPMTarget != null)
                                        {
                                            actionPMTarget(bindName);
                                            actionPMTarget(addBindeDev.BindName);
                                        }
                                        break;
                                }
@@ -1274,6 +1366,7 @@
                    break;
                case 4:
                    //PM2.5
                    removeDevice.BindCluster = 1066;
                    break;
            }
            removeDevice.BindMacAddr = bd.DeviceAddr;
@@ -1313,6 +1406,7 @@
                            foreach (var de in room.ListDevice)
                            {
                                var device = LocalDevice.Current.GetDevice(de);
                                if (device != null)
                                {
                                    //获取设备类型的
@@ -1347,6 +1441,17 @@
                            }
                            break;
                        case 4:
                            foreach (var de in room.ListDevice)
                            {
                                var device = LocalDevice.Current.GetDevice(de);
                                if (device != null)
                                {
                                    if (device.Type == DeviceType.PMSensor)
                                    {
                                        roomIncludeMatchDevice.Add(device);
                                    }
                                }
                            }
                            break;
                    }
@@ -1398,6 +1503,17 @@
                            roomIncludeMatchTempDevice.Add(device);
                        }
                    }
                    else if (device.Type == DeviceType.PMSensor)
                    {
                        var dev = device as PMSensor;
                        foreach (var clu in dev.InClusterList)
                        {
                            if (clu.InCluster == 1026)
                            {
                                roomIncludeMatchTempDevice.Add(device);
                            }
                        }
                    }
                }
            }
            return roomIncludeMatchTempDevice;
@@ -1426,6 +1542,17 @@
                        if (dev.SensorDiv == 2)
                        {
                            roomIncludeMatchHumpDevice.Add(device);
                        }
                    }
                    else if (device.Type == DeviceType.PMSensor)
                    {
                        var dev = device as PMSensor;
                        foreach (var clu in dev.InClusterList)
                        {
                            if (clu.InCluster == 1029)
                            {
                                roomIncludeMatchHumpDevice.Add(device);
                            }
                        }
                    }
                }
@@ -1549,6 +1676,24 @@
                    }
                    break;
                case 4:
                    foreach (var r in supportRoomList)
                    {
                        if (r.ListDevice.Count == 0)
                        {
                            continue;
                        }
                        foreach (var deviceKeys in r.ListDevice)
                        {
                            var device = LocalDevice.Current.GetDevice(deviceKeys);
                            if (device != null)
                            {
                                if (device.Type == DeviceType.PMSensor)
                                {
                                    currentPanelBindSupportDeviceListTemp.Add(device);
                                }
                            }
                        }
                    }
                    break;
            }
            return currentPanelBindSupportDeviceListTemp;
@@ -1602,6 +1747,17 @@
                    }
                    break;
                case 4:
                    foreach (var deviceKeys in curRoom.ListDevice)
                    {
                        var device = LocalDevice.Current.GetDevice(deviceKeys);
                        if (device != null)
                        {
                            if (device.Type == DeviceType.PMSensor)
                            {
                                curRoomDeviceListTemp.Add(device);
                            }
                        }
                    }
                    break;
            }
            return curRoomDeviceListTemp;
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
@@ -83,7 +83,7 @@
        /// <summary>
        /// 中部布局中门锁名称显示
        /// </summary>
        Button btnDoorLockTitle;
        NormalViewControl btnDoorLockTitle;
        /// <summary>
        /// 分享
        /// </summary>
@@ -252,18 +252,15 @@
            };
            this.midFrameLayout.AddChidren(midTopFrameLayout);
            //门锁标题
            btnDoorLockTitle = new Button()
            {
                Width = Application.GetRealWidth(250),
                Height = Application.GetRealHeight(60),
                X = Application.GetRealWidth(372),
                Y = Application.GetRealHeight(46),
                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextSize = 15,
                TextAlignment = TextAlignment.Center,
                IsBold = true,
            };
            //设备名称
            btnDoorLockTitle = new NormalViewControl(100, 60, true);
            btnDoorLockTitle.Y = Application.GetRealHeight(46);
            btnDoorLockTitle.TextSize = 15;
            btnDoorLockTitle.IsBold = true;
            btnDoorLockTitle.Text = Common.LocalDevice.Current.GetDeviceMacName(doorLock);
            btnDoorLockTitle.Width = btnDoorLockTitle.GetRealWidthByText();
            btnDoorLockTitle.TextAlignment = TextAlignment.Center;
            btnDoorLockTitle.Gravity = Gravity.CenterHorizontal;
            midTopFrameLayout.AddChidren(btnDoorLockTitle);
            //记录
@@ -863,7 +860,11 @@
                    {
                        Application.RunOnMainThread(() =>
                        {
                            NomallyOpenModeInvalidDialog();
                            Action<bool> action = (obj) =>
                            {
                                UpdateNomallyOpenStatus();
                            };
                            DoorLockCommonInfo.NomallyOpenModeInvalidDialog(doorLock, DoorLockCommonInfo.DoorLockMessType.AppOperate, haveLogicNormallyOpenMode, action);
                        });
                    }
                    else
@@ -893,7 +894,11 @@
                    {
                        Application.RunOnMainThread(() =>
                        {
                            NomallyOpenModeInvalidDialog();
                            Action<bool> action = (obj) =>
                            {
                                UpdateNomallyOpenStatus();
                            };
                            DoorLockCommonInfo.NomallyOpenModeInvalidDialog(doorLock, DoorLockCommonInfo.DoorLockMessType.AppOperate, haveLogicNormallyOpenMode, action);
                        });
                    }
                }
@@ -1043,7 +1048,6 @@
        /// </summary>
        private async void NomallyOpenDialog()
        {
            #region 后续版本
            if (UserCenterResourse.UserInfo.AuthorityNo != 1)
            {
                this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.OnlyMasterOperate));
@@ -1079,18 +1083,19 @@
                addLogicPage.action += (w) =>
                {
                    doorLock.IsDoorLockNormallyMode = w;
                    ///留给徐梅用的
                    UpdateNomallyOpenStatus();
                    //返回按键清空当前逻辑定义的LogicAction
                    UserCenter.DoorLock.DoorLockCommonInfo.LogicAction = null;
                };
            };
            HdlCheckLogic.Current.CheckSecondarySecurity(action);
            #endregion
        }
        /// <summary>
        /// 常开模式失效处理
        /// </summary>
        public void NomallyOpenModeInvalidDialog(bool IsFromReport = false)
        private void NomallyOpenModeInvalidDialog(bool IsFromReport = false)
        {
            if (!canShowDialog)
            {
ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs
@@ -334,6 +334,10 @@
        {
            //本地Socket
            public static Socket busSocket;
            /// <summary>
            /// 计时器
            /// </summary>
            private static int timeCount = 0;
            /// <summary>
            /// 启动Socket接收和发送功能
@@ -406,6 +410,13 @@
            private static void CheckConnectiton()
            {
                if (busSocket == null) { return; }
                timeCount++;
                if (timeCount < 20)
                {
                    //每10秒检测一次
                    return;
                }
                timeCount = 0;
                bool blockingState = busSocket.Blocking;
                try
ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs
@@ -476,6 +476,8 @@
            /// 温度测量功能的设备如:温度传感器。。。
            /// <para>1029:Relative Humidity Measurement,设备支持“湿度测量功能”</para>
            /// 湿度测量功能的设备如:湿度传感器。。。
            /// <para>1066:Pm2.5  Measurement,设备支持“pm2.5测量功能”</para>
            /// Pm2.5测量功能的设备如:Pm2.5传感器。。。
            /// </summary>
            public int InCluster;
        }
ZigbeeApp/Shared/Phone/ZigBee/Device/Enum.cs
@@ -50,6 +50,10 @@
        /// </summary>
        RelativeHumidityMeasurement = 1029,
        /// <summary>
        ///PM2.5测量功能
        /// </summary>
        PmTwoPointFiveMeasurement = 1066,
        /// <summary>
        /// 恒温器功能
        /// </summary>
        Thermostat = 513,
ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
@@ -3218,7 +3218,7 @@
                #endregion
                #region 设备状态上报
                else if (topic == gatewayID + "/" + "DeviceStatusReport" + "/" + addr + "/" + epoint + "/" + cluID + "/" + attrId)
                if (topic == gatewayID + "/" + "DeviceStatusReport" + "/" + addr + "/" + epoint + "/" + cluID + "/" + attrId)
                {
                    var deviceID = jobject.Value<int>("Device_ID");
                    var deviceAddr = jobject.Value<string>("DeviceAddr");
ZigbeeApp/Shared/R.cs
@@ -578,6 +578,31 @@
        /// 空气质量传感器
        /// </summary>
        public const int AirQualitySensor = 316;
        /// <summary>
        /// 优
        /// </summary>
        public const int ExcellentAirQuality = 317;
        /// <summary>
        /// 良
        /// </summary>
        public const int GoodAirQuality = 318;
        /// <summary>
        /// 轻度污染
        /// </summary>
        public const int LightPollution = 319;
        /// <summary>
        /// 中度污染
        /// </summary>
        public const int Moderatelyolluted = 320;
        /// <summary>
        /// 重度污染
        /// </summary>
        public const int HeavyPollution = 321;
        /// <summary>
        /// 严重污染
        /// </summary>
        public const int SeriousPollution = 322;
        public readonly static int cancel = 5097;
        public readonly static int confrim = 5098;
@@ -856,6 +881,7 @@
        public readonly static int addFailed = 5401;
        public readonly static int timeSensitive = 5402;
        public readonly static int executeSone = 5403;
        public readonly static int hour1 = 5404;