From 404cdc88627f942df7944af04ee05b9d527752d6 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 30 九月 2019 13:22:40 +0800
Subject: [PATCH] 合并了徐梅的按键面板绑定
---
ZigbeeApp/Shared/Common/Room.cs | 34 +++++++---------------------------
1 files changed, 7 insertions(+), 27 deletions(-)
diff --git a/ZigbeeApp/Shared/Common/Room.cs b/ZigbeeApp/Shared/Common/Room.cs
old mode 100644
new mode 100755
index f14649b..c9ca441
--- a/ZigbeeApp/Shared/Common/Room.cs
+++ b/ZigbeeApp/Shared/Common/Room.cs
@@ -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);
}
@@ -487,8 +477,10 @@
/// <param name="device">璁惧瀵硅薄</param>
public List<Room> GetRoomByDevice(CommonDevice device)
{
- var deviceUI = new DeviceUI { };
- deviceUI.DeviceFileName = device.FilePath;
+ var deviceUI = new DeviceUI { };
+ 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);
--
Gitblit v1.8.0