| | |
| | | this.listEsixtDevice.Clear();
|
| | | foreach (var device in listDevice)
|
| | | {
|
| | | this.listEsixtDevice.Add(Common.LocalDevice.Current.GetDeviceMainKeys(device));
|
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | if (listEsixtDevice.Contains(mainKeys) == false)
|
| | | {
|
| | | listEsixtDevice.Add(mainKeys);
|
| | | }
|
| | | }
|
| | | //获取PIR传感器的【光感等级总刻度】
|
| | | this.lightLevelCount = await HdlDevicePirSensorLogic.Current.GetPirLightAbilitySize(this.deviceIASZone);
|
| | |
| | | {
|
| | | //删除绑定目标
|
| | | var listDelDevice = new List<CommonDevice>();
|
| | | var listLightDevice = new List<CommonDevice>();
|
| | | foreach (string mainKey in listEsixtDevice)
|
| | | {
|
| | | if (this.listSaveDevice.Contains(mainKey) == false)
|
| | | {
|
| | | listDelDevice.Add(Common.LocalDevice.Current.GetDevice(mainKey));
|
| | | var myDevice = Common.LocalDevice.Current.GetDevice(mainKey);
|
| | | listDelDevice.Add(myDevice);
|
| | | if (myDevice.Type == DeviceType.DimmableLight)
|
| | | {
|
| | | //如果是调光器的话,特殊一点
|
| | | listLightDevice.Add(myDevice);
|
| | | }
|
| | | }
|
| | | }
|
| | | if (listDelDevice.Count > 0)
|
| | |
| | | this.CloseProgressBar();
|
| | | return;
|
| | | }
|
| | | if (listLightDevice.Count > 0)
|
| | | {
|
| | | //删除调光器镞
|
| | | listSucess = await HdlDeviceBindLogic.Current.DeleteDeviceTarget(deviceIASZone, listLightDevice, 8);
|
| | | if (listSucess == null || listSucess.Count == 0)
|
| | | {
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | //绑定目标
|
| | | var listBind = new List<CommonDevice>();
|
| | | listLightDevice = new List<CommonDevice>();
|
| | | foreach (var mainKey in listSaveDevice)
|
| | | {
|
| | | listBind.Add(Common.LocalDevice.Current.GetDevice(mainKey));
|
| | | var myDevice = Common.LocalDevice.Current.GetDevice(mainKey);
|
| | | listBind.Add(myDevice);
|
| | | if (myDevice.Type == DeviceType.DimmableLight)
|
| | | {
|
| | | //如果是调光器的话,特殊一点
|
| | | listLightDevice.Add(myDevice);
|
| | | }
|
| | | }
|
| | | if (listSaveDevice.Count > 0)
|
| | | {
|
| | |
| | | this.CloseProgressBar();
|
| | | return;
|
| | | }
|
| | | if (listLightDevice.Count > 0)
|
| | | {
|
| | | //绑定调光镞
|
| | | listSucess = await HdlDeviceBindLogic.Current.BindDeviceTarget(deviceIASZone, listLightDevice, 8);
|
| | | if (listSucess == null || listSucess.Count == 0)
|
| | | {
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | //保存pir配置信息
|