HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-09-30 404cdc88627f942df7944af04ee05b9d527752d6
ZigbeeApp/Shared/Common/Room.cs
old mode 100644 new mode 100755
@@ -27,7 +27,6 @@
                return $"Room_{Id}.json";
            }
        }
        /// <summary>
        /// 房间id--使用guid
        /// Guid.NewGuid().ToString()
@@ -211,21 +210,12 @@
            foreach (var roomFilePath in Config.Instance.Home.RoomFilePathList)
            {
                var room = GetRoomByFilePath(roomFilePath);
                System.Console.WriteLine(roomFilePath);
                System.Console.WriteLine(room?.FileName);
                System.Console.WriteLine(room?.Name);
                if (null != room)
                {
                    if (room.IsSharedRoom)
                    {
                        var sharedName = $"{room.Name}({Language.StringByID(R.MyInternationalizationString.Shared)})";
                        if (Lists.Find((obj) => obj.Name == sharedName) == null)
                        {
                        }
                        room.Name = $"{room.Name}({Language.StringByID(R.MyInternationalizationString.Shared)})";
                        room.Save();
                        room.Name = $"({Language.StringByID(R.MyInternationalizationString.Shared)}){room.Name}";
                    }
                    Lists.Add(room);
                }
@@ -488,7 +478,9 @@
        public List<Room> GetRoomByDevice(CommonDevice device)
        {
            var deviceUI = new DeviceUI { };
            deviceUI.DeviceFileName = device.FilePath;
            deviceUI.DeviceAddr = device.DeviceAddr;
            deviceUI.DeviceEpoint = device.DeviceEpoint;
            return Lists.FindAll((obj) => obj.DeviceUIFilePathList.Contains(deviceUI.FileName));
        }
@@ -698,19 +690,6 @@
            HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
            DeviceUI deviceUI = Common.LocalDevice.Current.GetDeviceUI(device);
            deviceUI.DeviceFileName = device.FilePath;
            if (backUpUI == true)
            {
                deviceUI.ReSave();
            }
            else
            {
                deviceUI.Save();
            }
            //添加自动备份
            HdlAutoBackupLogic.AddOrEditorFile(deviceUI.FileName);
            if (DeviceUIFilePathList.Contains(deviceUI.FileName) == false)
            {
                DeviceUIFilePathList.Add(deviceUI.FileName);
@@ -768,7 +747,8 @@
                return;
            }
            DeviceUI deviceUI = new DeviceUI();
            deviceUI.DeviceFileName = device.FilePath;
            deviceUI.DeviceAddr = device.DeviceAddr;
            deviceUI.DeviceEpoint = device.DeviceEpoint;
            //根据设备,获取所在的房间,因为它删的不一定是当前房间
            List<Room> listroom = this.GetRoomByDevice(device);