From bff8993501334c4f3c5f902216fe03253be747f8 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期三, 15 四月 2020 16:59:01 +0800 Subject: [PATCH] 合并新代码 --- ZigbeeApp20200414/Shared/Common/Device.cs | 66 +++++++++++++++++---------------- 1 files changed, 34 insertions(+), 32 deletions(-) diff --git a/ZigbeeApp20200414/Shared/Common/Device.cs b/ZigbeeApp20200414/Shared/Common/Device.cs index 614dbb6..494100f 100644 --- a/ZigbeeApp20200414/Shared/Common/Device.cs +++ b/ZigbeeApp20200414/Shared/Common/Device.cs @@ -968,7 +968,7 @@ /// <param name="device">璁惧瀵硅薄</param> /// <returns></returns> public string GetDeviceEpointName(CommonDevice device) - { + { string dName = this.GetSimpleEpointName(device); if (string.IsNullOrEmpty(dName) == false) { @@ -1587,7 +1587,7 @@ { //榛樿鍊� info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId4100; - info.BeloneType = DeviceBeloneType.A鏅鸿兘绌哄紑; + info.BeloneType = DeviceBeloneType.A寮�鍏�; info.ConcreteType = DeviceConcreteType.AirSwitch; info.ObjectTypeNameId = 60001;//寮�鍏虫ā鍧� @@ -1741,22 +1741,15 @@ info.ConcreteType = DeviceConcreteType.Sensor_Humidity; } info.ObjectTypeNameId = 60000;//浼犳劅鍣� - } - - //14鏂伴 - //else if (dicType.ContainsKey(DeviceType.FreshAir) == true) - //{ - // info. = R.MyInternationalizationString.uDeviceBelongId18; - // info.BeloneType = DeviceBeloneType.;//鏂伴闈㈡澘涓殑绗竴鍥炶矾鏄柊椋庤澶� - // info.ConcreteType = DeviceConcreteType.ButtonPanel_FangyueFreshAir; - // info.ObjectTypeNameId = 60011;//鏂伴 - //} - //int value = (int)info.BeloneType; - //if (dicDeviceAllNameID.ContainsKey("uDeviceBelongId" + value) == true) - //{ - // //璁惧鎵�灞炵被鍨嬬殑缈昏瘧鍚嶅瓧 - // info.BeloneTextId = dicDeviceAllNameID["uDeviceBelongId" + value]; - //} + } + + int value = (int)info.BeloneType; + if (dicDeviceAllNameID.ContainsKey("uDeviceBelongId" + value) == true) + { + //璁惧鎵�灞炵被鍨嬬殑缈昏瘧鍚嶅瓧 + info.BeloneTextId = dicDeviceAllNameID["uDeviceBelongId" + value]; + } + return info; } @@ -1892,12 +1885,7 @@ return Language.StringByID(R.MyInternationalizationString.uDeviceNotAssignedRoom); } var room = HdlRoomLogic.Current.GetRoomById(this.dicDeviceRoomId[device.DeviceAddr]); - if (room != null) - { - return room.Name; - } - //鏈垎閰嶅尯鍩� - return Language.StringByID(R.MyInternationalizationString.uDeviceNotAssignedRoom); + return HdlRoomLogic.Current.GetFloorRoomName(room); } /// <summary> @@ -2032,12 +2020,15 @@ //杩欎釜璁惧涓嶈浜� return false; } - if (i_device.Type == DeviceType.OnOffOutput && i_device.DfunctionType == DeviceFunctionType.A鏈畾涔�) + if (i_device.Type == DeviceType.OnOffOutput || i_device.Type == DeviceType.AirSwitch) { //2020.03.23杩藉姞寮忔牱:鏈寚瀹氱被鍨嬬殑缁х數鍣�,涓嶆樉绀� - return false; - } - //濡傛灉鏄柊椋庨潰鏉跨殑鏂伴璁惧,鍒欎笉鏄剧ず + if (i_device.DfunctionType == DeviceFunctionType.A鏈畾涔�) + { + return false; + } + } + //濡傛灉鏄柊椋庨潰鏉跨殑鏂伴璁惧,鍒欎笉鏄剧ず else if (i_device.Type == DeviceType.FreshAir) { var myInfoType = LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { i_device }); @@ -2210,7 +2201,7 @@ var listCheck = new HashSet<string>(); Action<string, string> getDeviceAction = (topic, message) => { - if (topic == gatewayID + "/" + "DeviceInfoRespon") + if (topic == gatewayID + "/DeviceInfoRespon") { try { @@ -2258,6 +2249,9 @@ //璁惧鍏ㄩ儴鎺ユ敹瀹屾垚 canBreak = true; } + } + else if (topic == gatewayID + "/DeviceInfoResponEnd") + { } }; @@ -2478,10 +2472,10 @@ else if (deviceType == DeviceType.WindowCoveringDevice) { device = new Rollershade(); } else if (deviceType == DeviceType.IASZone) { device = new IASZone(); } else if (deviceType == DeviceType.Repeater) { device = new Repeater(); } - else if (deviceType == DeviceType.Thermostat) { device = new AC(); } + else if (deviceType == DeviceType.Thermostat) { device = new AC(); } else if (deviceType == DeviceType.FreshAir) { device = new FreshAir(); } else if (deviceType == DeviceType.DoorLock) { device = new DoorLock(); } - else if (deviceType == DeviceType.TemperatureSensor) { device = new TemperatureSensor(); } + else if (deviceType == DeviceType.TemperatureSensor) { device = new TemperatureSensor(); } else if (deviceType == DeviceType.FreshAirHumiditySensor) { device = new HumiditySensor(); } else if (deviceType == DeviceType.OtaDevice || deviceType == DeviceType.OtaPanelDevice) { device = new OTADevice(); } else { return null; } @@ -2572,16 +2566,24 @@ this.dicDeviceModelIdEnum["MSPIR01-ZB.10"] = "1200-1200-60000";//pir浼犳劅鍣�220 //=========鈽呪槄瀹夐槻绫讳紶鎰熷櫒绫�(1300-2299)鈽呪槄========= + //杩欓噷鏄害涔愬厠鐨� this.dicDeviceModelIdEnum["MULTI-GASE--EA07"] = "1300-1300-60000";//鐕冩皵浼犳劅鍣� this.dicDeviceModelIdEnum["MULTI-MECI--EA01"] = "1301-1300-60000";//闂ㄧ獥纾佷紶鎰熷櫒 this.dicDeviceModelIdEnum["MULTI-FIRE--EA05"] = "1302-1300-60000";//鐑熼浘浼犳劅鍣� this.dicDeviceModelIdEnum["MULTI-MOTI--EA04"] = "1303-1300-60000";//绾㈠浼犳劅鍣� this.dicDeviceModelIdEnum["MULTI-WATE--EA02"] = "1304-1300-60000";//姘存蹈浼犳劅鍣� this.dicDeviceModelIdEnum["MULTI-BURO--EA06"] = "1305-1300-60000";//绱ф�ユ寜閿� + //杩欓噷鏄渤涓滅殑 + this.dicDeviceModelIdEnum["MSG01/M-ZB.10"] = "1300-1300-60000";//鐕冩皵浼犳劅鍣� + this.dicDeviceModelIdEnum["MSDC01/M-ZB.10"] = "1301-1300-60000";//闂ㄧ獥纾佷紶鎰熷櫒 + this.dicDeviceModelIdEnum["MSS01/M-ZB.10"] = "1302-1300-60000";//鐑熼浘浼犳劅鍣� + this.dicDeviceModelIdEnum["MSPIR01/M-ZB.10"] = "1303-1300-60000";//绾㈠浼犳劅鍣� + this.dicDeviceModelIdEnum["MSW01/M-ZB.10"] = "1304-1300-60000";//姘存蹈浼犳劅鍣� + this.dicDeviceModelIdEnum["MBU01/M-ZB.10"] = "1305-1300-60000";//绱ф�ユ寜閿� //=========鈽呪槄缁х數鍣ㄧ被(2300-2499)鈽呪槄========= this.dicDeviceModelIdEnum["MPR0310-ZB.10"] = "2300-2300-60001";//3璺户鐢靛櫒灏忔ā鍧� - this.dicDeviceModelIdEnum["MFA01-ZB1.0"] = "2310-2300-60001";//鏂规偊鏂伴灏忔ā鍧� + this.dicDeviceModelIdEnum["MFA01-ZB.10"] = "2310-2300-60011";//鏂规偊鏂伴灏忔ā鍧� //=========鈽呪槄璋冨厜鍣ㄧ被(2500-2799)鈽呪槄========= this.dicDeviceModelIdEnum["MPD0101-ZB.10"] = "2500-2500-60007";//1璺皟鍏夊櫒灏忔ā鍧� -- Gitblit v1.8.0