From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 17 十二月 2020 09:07:13 +0800 Subject: [PATCH] 新云端Ver1.3 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs | 90 +++++++++++++++++++++++++++++---------------- 1 files changed, 58 insertions(+), 32 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs index 12546e0..5e26485 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs @@ -37,6 +37,10 @@ /// 绌鸿皟鐩爣 /// </summary> AC = 5, + /// <summary> + /// 鍦版殩鐩爣 + /// </summary> + Fh = 6, } #endregion @@ -126,7 +130,7 @@ case BindType.FreshAir: foreach (var deviceKeys in curRoom.ListDevice) { - var device = LocalDevice.Current.GetDevice(deviceKeys); + var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys); if (device != null) { if (BindInfo.checkRealFreshAirDevice(device) == false) @@ -147,7 +151,7 @@ curRoomDeviceListTemp = GetMatchHumiditySensorDevice(curRoom); foreach (var deviceKeys in curRoom.ListDevice) { - var device = LocalDevice.Current.GetDevice(deviceKeys); + var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys); if (device != null) { if (device.Type == DeviceType.FreshAirHumiditySensor) @@ -160,7 +164,7 @@ case BindType.PM: foreach (var deviceKeys in curRoom.ListDevice) { - var device = LocalDevice.Current.GetDevice(deviceKeys); + var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys); if (device != null) { if (device.Type == DeviceType.PMSensor) @@ -173,7 +177,7 @@ case BindType.AC: foreach (var deviceKeys in curRoom.ListDevice) { - var device = LocalDevice.Current.GetDevice(deviceKeys); + var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys); if (device != null) { if (device.Type == DeviceType.Thermostat) @@ -200,7 +204,7 @@ List<CommonDevice> roomIncludeMatchTempDevice = new List<CommonDevice>(); foreach (var de in room.ListDevice) { - var device = LocalDevice.Current.GetDevice(de); + var device = HdlDeviceCommonLogic.Current.GetDevice(de); if (device != null) { //鐢垫睜璁惧涓嶆敮鎸佺粦瀹� @@ -211,6 +215,10 @@ if (device.Type == DeviceType.TemperatureSensor) { var dev = device as TemperatureSensor; + if (BindInfo.checkRealTemperatureDevice(device) == false) + { + continue; + } if (dev.SensorDiv == 1) { roomIncludeMatchTempDevice.Add(device); @@ -241,7 +249,7 @@ List<CommonDevice> roomIncludeMatchHumpDevice = new List<CommonDevice>(); foreach (var de in room.ListDevice) { - var device = LocalDevice.Current.GetDevice(de); + var device = HdlDeviceCommonLogic.Current.GetDevice(de); if (device != null) { //鐢垫睜璁惧涓嶆敮鎸佺粦瀹� @@ -252,6 +260,10 @@ if (device.Type == DeviceType.TemperatureSensor) { var dev = device as TemperatureSensor; + if (BindInfo.checkRealTemperatureDevice(device) == false) + { + continue; + } if (dev.SensorDiv == 2) { roomIncludeMatchHumpDevice.Add(device); @@ -274,10 +286,10 @@ } /// <summary> - /// 鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂村垪琛� + /// 鑾峰彇鏀寔鐨勬埧闂村垪琛� /// </summary> /// <returns></returns> - public static List<Room> GetFloorRoomList() + public static List<Room> GetSupportRoomList() { var supportRoomListTemp = new List<Room>(); var listAllRoom = HdlRoomLogic.Current.GetAllListRooms(); @@ -344,13 +356,10 @@ case BindInfo.BindType.FreshAir: foreach (var de in room.ListDevice) { - var device = LocalDevice.Current.GetDevice(de); + var device = HdlDeviceCommonLogic.Current.GetDevice(de); if (device != null) { - //鑾峰彇璁惧绫诲瀷鐨� - var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); - //鏂伴闈㈡澘鐨勬柊椋庤澶囷紝鍒欎笉鏄剧ず - if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir) + if (BindInfo.checkRealFreshAirDevice(device) == false) { continue; } @@ -368,7 +377,7 @@ roomIncludeMatchDevice = GetMatchHumiditySensorDevice(room); foreach (var de in room.ListDevice) { - var device = LocalDevice.Current.GetDevice(de); + var device = HdlDeviceCommonLogic.Current.GetDevice(de); if (device != null) { if (device.Type == DeviceType.FreshAirHumiditySensor) @@ -381,7 +390,7 @@ case BindInfo.BindType.PM: foreach (var de in room.ListDevice) { - var device = LocalDevice.Current.GetDevice(de); + var device = HdlDeviceCommonLogic.Current.GetDevice(de); if (device != null) { if (device.Type == DeviceType.PMSensor) @@ -394,7 +403,7 @@ case BindInfo.BindType.AC: foreach (var de in room.ListDevice) { - var device = LocalDevice.Current.GetDevice(de); + var device = HdlDeviceCommonLogic.Current.GetDevice(de); if (device != null) { if (device.Type == DeviceType.Thermostat) @@ -443,7 +452,7 @@ List<CommonDevice> UndistributeCommonDeviceListTemp = new List<CommonDevice>(); //鑾峰彇鏈湴璁惧鍒楄〃 - foreach (var tempDev in Shared.Common.LocalDevice.Current.listAllDevice) + foreach (var tempDev in HdlDeviceCommonLogic.Current.listAllDevice) { //鑾峰彇璁惧鎵�灞炴埧闂� var tempDevRoom = HdlRoomLogic.Current.GetRoomByDevice(tempDev); @@ -575,7 +584,7 @@ } foreach (var deviceKeys in r.ListDevice) { - var device = LocalDevice.Current.GetDevice(deviceKeys); + var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys); if (device != null) { if (BindInfo.checkRealFreshAirDevice(device) == false) @@ -618,7 +627,7 @@ } foreach (var deviceKeys in r.ListDevice) { - var device = LocalDevice.Current.GetDevice(deviceKeys); + var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys); if (device != null) { if (device.Type == DeviceType.FreshAirHumiditySensor) @@ -638,7 +647,7 @@ } foreach (var deviceKeys in r.ListDevice) { - var device = LocalDevice.Current.GetDevice(deviceKeys); + var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys); if (device != null) { if (device.Type == DeviceType.PMSensor) @@ -658,7 +667,7 @@ } foreach (var deviceKeys in r.ListDevice) { - var device = LocalDevice.Current.GetDevice(deviceKeys); + var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys); if (device != null) { if (device.Type == DeviceType.Thermostat) @@ -703,7 +712,7 @@ } /// <summary> - /// 鏄惁鏄湡瀹炵殑绌鸿皟璁惧 銆愰儴鍒嗘槸鑳界粦瀹氱┖璋冪殑璁惧銆� + /// 鏄惁鏄湡瀹炵殑绌鸿皟璁惧 銆愯繃婊erver绔�� /// </summary> /// <param name="device"></param> /// <returns></returns> @@ -711,7 +720,7 @@ { bool result = true; //鑾峰彇璁惧绫诲瀷鐨� - var clu = device.OutClusterList.Find((obj) => obj.OutCluster == 513); + var clu = device.OutClusterList.Find((obj) => obj.OutCluster == 513 || obj.OutCluster == 514); if (clu != null) { result = false; @@ -720,7 +729,7 @@ } /// <summary> - /// 鏄惁鏄湡瀹炵殑鏂伴璁惧 銆愰儴鍒嗘槸鑳界粦瀹氭柊椋庣殑璁惧銆� + /// 鏄惁鏄湡瀹炵殑鏂伴璁惧 銆愯繃婊erver绔�� /// </summary> /// <param name="device"></param> /// <returns></returns> @@ -728,12 +737,8 @@ { bool result = true; //鑾峰彇璁惧绫诲瀷鐨� - var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); - if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir) - { - result = false; - } - if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleEnvironment) + var clu = device.OutClusterList.Find((obj) => obj.OutCluster == 514); + if (clu != null) { result = false; } @@ -741,7 +746,28 @@ } /// <summary> - /// 妫�娴嬭璁惧鑳藉惁鏄剧ず + /// 鏄惁鏄湡瀹炵殑娓╁害璁惧 銆愯繃婊erver绔�� + /// </summary> + /// <param name="device"></param> + /// <returns></returns> + public static bool checkRealTemperatureDevice(CommonDevice device) + { + bool result = true; + //鑾峰彇璁惧灞炰簬銆愮畝绾﹀鍔熻兘闈㈡澘銆� + var deviceEnumInfo = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(new List<CommonDevice> { device }); + if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction) + { + if (device.Type == DeviceType.TemperatureSensor && device.DeviceEpoint == 1) + { + //绠�绾﹀鍔熻兘闈㈡澘绗�1鍥炶矾鏄竴涓粦瀹氭俯婀垮害浼犳劅鍣ㄧ绫诲瀷锛屼笉鏄湡鐨勬俯婀垮害鐨勪紶鎰熷櫒锛岄渶瑕佸睆钄芥帀 + result = false; + } + } + return result; + } + + /// <summary> + /// 妫�娴嬭璁惧鑳藉惁鏄剧ず銆愯繃婊erver绔�� /// </summary> /// <param name="device"></param> /// <returns></returns> @@ -776,7 +802,7 @@ } foreach (var deviceKeys in room.ListDevice) { - var device = Common.LocalDevice.Current.GetDevice(deviceKeys); + var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys); //妫�娴嬭璁惧鑳藉惁鏄剧ず if (CheckCanShowDevice(device, curDeviceBindType) == false) { -- Gitblit v1.8.0