From 71f1df7772feec5cf83feefa851608adac18e005 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期三, 06 十一月 2019 17:45:23 +0800 Subject: [PATCH] 2019.11.6 --- ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs index ae5cd7d..965a4d8 100644 --- a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs +++ b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs @@ -145,7 +145,30 @@ } else if (typeTag == "OnlineStatusChange") { - + Application.RunOnMainThread(() => + { + try + { + var deviceUI = device; + //璁惧涓虹┖ + if (deviceUI.CommonDevice == null) + { + return; + } + //鏄惁涓哄綋鍓嶈澶� + if (deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint || deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr) + { + return; + } + deviceUI.CommonDevice.IsOnline = common.IsOnline; + deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1; + deviceUI.CommonDevice.LastDateTime = DateTime.Now; + } + catch (Exception ex) + { + System.Console.WriteLine($"Error:{ex.Message}"); + } + }); } } #endregion -- Gitblit v1.8.0