From 46a177eb1acf7ce91af7fe9ff57af87228de938d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 17 十月 2023 10:03:24 +0800
Subject: [PATCH] IOS库更新

---
 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs |   39 +++++++++++++++++++++++++++++++--------
 1 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
index 1c14381..7e6f261 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -269,15 +269,15 @@
 
             if (!Control.Ins.GatewayOnline_Local && !Control.Ins.GatewayOnline_Cloud)
             {
-                bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipFail;
-                bodyView.btnLinkStateTip.TextID = StringId.NetworkAnomaly;
-                bodyView.environmentalView.Y = Application.GetRealHeight(8) + btnResidenceName.Bottom;
+                bodyView.divLinkStateTip.Visible = true;
             }
+            //else if ()
+            //{
+            //    bodyView.divLinkStateTip.Visible = true;
+            //}
             else
             {
-                bodyView.btnLinkStateTip.BackgroundColor = 0x00000000;
-                bodyView.btnLinkStateTip.Text = "";
-                bodyView.environmentalView.Y = Application.GetRealHeight(1) + btnResidenceName.Bottom;
+                bodyView.divLinkStateTip.Visible = false;
             }
         }
 
@@ -351,11 +351,17 @@
             }
         }
 
+        object lockObj = new object();
+
         /// <summary>
         /// 鏇存柊鏄剧ず鐘舵��
         /// </summary>
         public static void UpdataFunctionStates(Function function)
         {
+            if(bodyView == null)
+            {
+                return;
+            }
             Application.RunOnMainThread(() =>
             {
                 try
@@ -424,12 +430,28 @@
                                         }
                                     }
                                 }
-                                else if(function.spk == SPK.SensorHelp)
+                                else if (function.spk == SPK.SensorHelp)
                                 {
                                     var tempStatus = function.attributes.Find((sta) => sta.key == FunctionAttributeKey.AlarmStatus);
-                                    if(tempStatus != null)
+                                    if (tempStatus != null)
                                     {
                                         state = tempStatus.curValue.ToString() == "alarm";
+                                    }
+                                }
+                                else if (function.spk == SPK.SensorPir || function.spk == SPK.SensorPirHold)
+                                {
+                                    var tempStatus = function.attributes.Find((sta) => sta.key == "people_status");
+                                    if (tempStatus != null)
+                                    {
+                                        state = tempStatus.curValue.ToString() == "true";
+                                    }
+                                }
+                                else if (function.spk == SPK.SensorDryContact || function.spk == SPK.SensorDryContact2)
+                                {
+                                    var tempStatus = function.attributes.Find((sta) => sta.key == "contact_status");
+                                    if (tempStatus != null)
+                                    {
+                                        state = tempStatus.curValue.ToString() == "open";
                                     }
                                 }
                                 else
@@ -566,6 +588,7 @@
                             btnSwitch.IsSelected = !btnSwitch.IsSelected;
                         });
                     }
+                   
                     function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                     Dictionary<string, string> d = new Dictionary<string, string>();
                     if (function.spk == SPK.LightDimming || function.spk == SPK.LightRGB)

--
Gitblit v1.8.0