From 7b43f0f5c5dca88576efc0bb51bf95b523de90c9 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 10 七月 2020 11:33:06 +0800
Subject: [PATCH] 2020-07-10 1.修复窗帘定时器发送控制失败问题。

---
 Crabtree/ON.Ios/AppDelegate.cs |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Crabtree/ON.Ios/AppDelegate.cs b/Crabtree/ON.Ios/AppDelegate.cs
index 813897b..b7c99bd 100644
--- a/Crabtree/ON.Ios/AppDelegate.cs
+++ b/Crabtree/ON.Ios/AppDelegate.cs
@@ -6,6 +6,7 @@
 using Microsoft.AppCenter.Analytics;
 using Microsoft.AppCenter.Crashes;
 using Shared;
+using Shared.SimpleControl;
 using UIKit;
 using UserNotifications;
 
@@ -256,14 +257,14 @@
             //com.freeview.global.Video.FVapplicationDidBecomeActive (application);
         }
 
-        //DateTime closeTime = DateTime.MinValue;
+        DateTime closeTime = DateTime.MinValue;
         /// <summary>
         /// BusSocketStop
         /// </summary>
         void BusSocketStop ()
         {
             Shared.BusSocket.Stop ();
-            //closeTime = DateTime.Now;
+            closeTime = DateTime.Now;
         }
 
 
@@ -273,6 +274,14 @@
         void BusSocketStart ()
         {
 
+            if (closeTime == DateTime.MinValue) {
+                closeTime = DateTime.Now;
+            } else if (closeTime.AddSeconds (20) < DateTime.Now) {
+                if (CommonPage.IsRemote) {
+                    SmartHome.MqttCommon.DisConnectRemoteMqttClient ("closeTime");
+                }
+            }
+
             //if (closeTime == DateTime.MinValue) {
             //    closeTime = DateTime.Now;
             //} else if (closeTime.AddMinutes (2) > DateTime.Now) {

--
Gitblit v1.8.0