From bbc74a6dae2e90a811b2507c5896fe89aa29ccc0 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 08 一月 2020 11:30:46 +0800
Subject: [PATCH] 2020-01-08 1.替换新服务器接口。

---
 Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs b/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs
index dc07c45..337dd4e 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs
@@ -105,12 +105,12 @@
                                                 var gatewayBytes = control.UsefulBytes;
                                                 #endregion
                                                 if (gatewayBytes != null) {
-                                                    common.Remote_GroupName = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 1, 20).Trim ('\0');
-                                                    common.Remote_ProjectName = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 21, 20).Trim ('\0');
-                                                    common.Remote_UserName = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 41, 8).Trim ('\0');
-                                                    common.Remote_Password = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 49, 8).Trim ('\0');
-                                                    var requestJson2 = @"{'Token':'" + MainPage.LoginUser.LoginTokenString + "','MAC':'" + common.MAC + "','Password':'" + common.Remote_Password + "'}";
-                                                    var revertObj2 = MainPage.RequestHttps ("UpdateRemoteSwitchPassword", requestJson2, true, false);
+                                                    //common.Remote_GroupName = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 1, 20).Trim ('\0');
+                                                    //common.Remote_ProjectName = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 21, 20).Trim ('\0');
+                                                    //common.Remote_UserName = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 41, 8).Trim ('\0');
+                                                    //common.Remote_Password = CommonPage.MyEncodingGB2312.GetString (gatewayBytes, 49, 8).Trim ('\0');
+                                                    //var requestJson2 = @"{'Token':'" + MainPage.LoginUser.LoginTokenString + "','MAC':'" + common.MAC + "','Password':'" + common.Remote_Password + "'}";
+                                                    //var revertObj2 = MainPage.RequestHttps ("UpdateRemoteSwitchPassword", requestJson2, true, false);
                                                     return;
                                                 }
                                                 Application.RunOnMainThread (() => {
@@ -130,9 +130,11 @@
                             }
                         }
                         if (canRemote && !CommonPage.IsRemote) {
-                            if (!string.IsNullOrEmpty (UserConfig.Instance.CurrentRegion.MAC)) {
-                                Shared.SimpleControl.CommonPage.IsRemote = true;
-                                await SmartHome.MqttCommon.StartCloudMqtt ();
+                            if (UserConfig.Instance.CheckHomeGateways ()) {
+                                if (!string.IsNullOrEmpty (UserConfig.Instance.CurrentRegion.HomeGateways[0].GatewayUniqueId)) {
+                                    Shared.SimpleControl.CommonPage.IsRemote = true;
+                                    await SmartHome.MqttCommon.StartCloudMqtt ();
+                                }
                             }
                         }
                     }

--
Gitblit v1.8.0