陈嘉乐
2020-05-19 0e0584b87851c56745bf73b1a961b80613dd0721
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs
old mode 100644 new mode 100755
@@ -58,6 +58,8 @@
            this.InitDeviceData();
            //初始化场景
            this.InitSceneData();
            //刷新左边刷新房间视图列表
            HdlRoomLogic.Current.RefreshRoomListView();
        }
        #endregion
@@ -105,6 +107,9 @@
            house.Save(false);
            Config.Instance.HomeId = house.Id;
            Config.Instance.Home = House.GetHouseByHouseId(house.Id);
            //预创建个人中心全部的文件夹
            UserCenterLogic.CreatAllUserCenterDirectory();
        }
        #endregion
@@ -215,10 +220,10 @@
            foreach (var floorKey in listFloorKey)
            {
                //客厅
                //list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A2按键面板, RoomId = floorKey + "_KeTing", DeviceCount = 1 });
                //list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A3按键面板, RoomId = floorKey + "_KeTing", DeviceCount = 1 });
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A2按键面板, RoomId = floorKey + "_KeTing", DeviceCount = 1 });
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A3按键面板, RoomId = floorKey + "_KeTing", DeviceCount = 1 });
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A4按键面板, RoomId = floorKey + "_KeTing", DeviceCount = 2 });
                //list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A空调网关, RoomId = floorKey + "_KeTing", DeviceCount = 1 });
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A空调网关, RoomId = floorKey + "_KeTing", DeviceCount = 1 });
                //阳台
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A220pir传感器, RoomId = floorKey + "_YangTai", DeviceCount = 1 });
@@ -234,7 +239,6 @@
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A空气开关, RoomId = floorKey + "_XuanGuan", DeviceCount = 1 });
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A1路调光器, RoomId = floorKey + "_XuanGuan", DeviceCount = 1 });
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A门窗磁传感器, RoomId = floorKey + "_XuanGuan", DeviceCount = 1 });
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A智能门锁, RoomId = floorKey + "_XuanGuan", DeviceCount = 1 });
                //厨房
                list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A4按键面板, RoomId = floorKey + "_ChuFang", DeviceCount = 1 });
@@ -562,6 +566,7 @@
                //1个传感器
                var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
                device.IasDeviceType = 13;
                device.DeviceID = 1026;
                //设置设备的基本信息
                this.SetBaseDataToDevice(device, 1200, 1200, "MSPIR01-ZB.10", i_RoomId);
@@ -582,6 +587,7 @@
            {
                var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
                device.IasDeviceType = 43;
                device.DeviceID = 1026;
                //设置设备的基本信息
                this.SetBaseDataToDevice(device, 1300, 1300, "MSG01/M-ZB.10", i_RoomId);
@@ -595,6 +601,7 @@
            {
                var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
                device.IasDeviceType = 43;
                device.DeviceID = 1026;
                //设置设备的基本信息
                this.SetBaseDataToDevice(device, 1300, 1300, "MGCD01/ZB.10", i_RoomId);
@@ -608,6 +615,7 @@
            {
                var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
                device.IasDeviceType = 21;
                device.DeviceID = 1026;
                //设置设备的基本信息
                this.SetBaseDataToDevice(device, 1301, 1301, "MSDC01/M-ZB.10", i_RoomId);
@@ -621,6 +629,7 @@
            {
                var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
                device.IasDeviceType = 40;
                device.DeviceID = 1026;
                //设置设备的基本信息
                this.SetBaseDataToDevice(device, 1301, 1301, "MSS01/M-ZB.10", i_RoomId);
@@ -634,6 +643,7 @@
            {
                var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
                device.IasDeviceType = 13;
                device.DeviceID = 1026;
                //设置设备的基本信息
                this.SetBaseDataToDevice(device, 1303, 1303, "MSPIR01/M-ZB.10", i_RoomId);
@@ -647,6 +657,7 @@
            {
                var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
                device.IasDeviceType = 42;
                device.DeviceID = 1026;
                //设置设备的基本信息
                this.SetBaseDataToDevice(device, 1304, 1304, "MSW01/M-ZB.10", i_RoomId);
@@ -660,6 +671,7 @@
            {
                var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
                device.IasDeviceType = 44;
                device.DeviceID = 1026;
                //设置设备的基本信息
                this.SetBaseDataToDevice(device, 1305, 1305, "MBU01/M-ZB.10", i_RoomId);
@@ -902,10 +914,24 @@
            device.ModelIdentifier = ModelIdentifier;
            device.CurrentGateWayId = string.Empty;
            //默认每个设备都可以定位
            //默认每个设备都可以定位,拥有开关功能
            device.InClusterList.Add(new CommonDevice.InClusterObj { InCluster = 3 });
            device.OutClusterList.Add(new CommonDevice.OutClusterObj { OutCluster = 3 });
            if (device.Type == DeviceType.AirSwitch || device.Type == DeviceType.OnOffOutput
                || device.Type == DeviceType.DimmableLight || device.Type == DeviceType.ColorDimmableLight)
            {
                device.InClusterList.Add(new CommonDevice.InClusterObj { InCluster = 6 });
                device.OutClusterList.Add(new CommonDevice.OutClusterObj { OutCluster = 6 });
            }
            if (device.Type == DeviceType.OnOffOutput || device.Type == DeviceType.DimmableLight
                || device.Type == DeviceType.ColorDimmableLight)
            {
                device.InClusterList.Add(new CommonDevice.InClusterObj { InCluster = 8 });
            }
            if (device.Type == DeviceType.WindowCoveringDevice)
            {
                device.InClusterList.Add(new CommonDevice.InClusterObj { InCluster = 258 });
            }
            //添加虚拟设备
            LocalDevice.Current.AddVirtualDeviceToMemory(device);