From 1fa13087ee7be5502e2e42cbd07cf185cbc69a9c Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 12 十月 2023 13:57:23 +0800 Subject: [PATCH] Merge branch 'wxr-2.1' into wxr-2.2 --- HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs index 34599ea..7e6f261 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs @@ -430,14 +430,30 @@ } } } - 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 { state = function.trait_on_off.curValue.ToString() == "on"; -- Gitblit v1.8.0