| | |
| | | this.InitDeviceData();
|
| | | //初始化场景
|
| | | this.InitSceneData();
|
| | | //刷新左边刷新房间视图列表
|
| | | HdlRoomLogic.Current.RefreshRoomListView();
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | house.IsVirtually = true;
|
| | | house.Save(false);
|
| | | Config.Instance.HomeId = house.Id;
|
| | | Config.Instance.Home = House.GetHouseByHouseId(house.Id);
|
| | | Config.Instance.Home = HdlResidenceLogic.Current.GetHouseByHouseId(house.Id);
|
| | |
|
| | | //预创建个人中心全部的文件夹
|
| | | UserCenterLogic.CreatAllUserCenterDirectory();
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | 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 });
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A水浸传感器, RoomId = floorKey + "_ChuFang", DeviceCount = 1 });
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A烟雾传感器, RoomId = floorKey + "_ChuFang", DeviceCount = 1 });
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A燃气传感器, RoomId = floorKey + "_ChuFang", DeviceCount = 1 });
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A吸顶燃气传感器, RoomId = floorKey + "_ChuFang", DeviceCount = 1 });
|
| | |
|
| | | //走廊
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A4按键面板, RoomId = floorKey + "_ZouLang", DeviceCount = 1 });
|
| | |
| | | {
|
| | | //先刷新容器
|
| | | LocalDevice.Current.ReFreshByLocal();
|
| | | //顺便也整一下网关(有可能它是从实体账号转为虚拟时,没有清空)
|
| | | HdlGatewayLogic.Current.ReFreshByLocal();
|
| | | HdlGatewayLogic.Current.RefreshAppOldSelectGatewayId();
|
| | |
|
| | | Type thisType = m_Current.GetType();
|
| | | //获取需要创建的虚拟设备列表
|
| | |
| | | //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);
|
| | |
|
| | |
| | | {
|
| | | 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);
|
| | |
|
| | | this.DeviceNumber++;
|
| | | }
|
| | | }
|
| | |
|
| | | public void Zigbee吸顶燃气传感器(int i_DeviceCount, string i_RoomId)
|
| | | {
|
| | | for (int i = 0; i < i_DeviceCount; i++)
|
| | | {
|
| | | 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);
|
| | |
|
| | | this.DeviceNumber++;
|
| | | }
|
| | |
| | | {
|
| | | 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);
|
| | |
|
| | |
| | | {
|
| | | 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);
|
| | |
|
| | |
| | | {
|
| | | 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);
|
| | |
|
| | |
| | | {
|
| | | 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);
|
| | |
|
| | |
| | | {
|
| | | 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);
|
| | |
|
| | |
| | | this.SetBaseDataToDevice(device, 2300, 2300, "MPD0101-ZB.10", i_RoomId);
|
| | | }
|
| | |
|
| | | //1个继电器
|
| | | var device2 = new ToggleLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 8 };
|
| | | //1个调光器
|
| | | var device2 = new DimmableLight() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 8 };
|
| | | device2.DfunctionType = DeviceFunctionType.A灯光;
|
| | | //设置设备的基本信息
|
| | | this.SetBaseDataToDevice(device2, 2300, 2300, "MPD0101-ZB.10", i_RoomId);
|
| | |
| | | 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);
|
| | |
|
| | |
| | | A方悦双开四控面板 = 23,
|
| | | A方悦四开八控面板 = 24,
|
| | | A方悦新风面板 = 25,
|
| | | A方悦新风小模块 = 26
|
| | | A方悦新风小模块 = 26,
|
| | | A吸顶燃气传感器 = 27,
|
| | | }
|
| | |
|
| | | #endregion
|