From 44538302375e489af520e320de908d8cfcf43691 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 21 二月 2022 13:49:32 +0800
Subject: [PATCH] HomeKit对接说明

---
 SiriIntents/SiriIntents.csproj                                               |    2 
 HDL_ON/UI/UI2/1-HomePage/HomePage.cs                                         |   11 +
 HDL-ON_iOS/HDL-ON_iOS.csproj                                                 |    4 
 HDL_ON/Common/ApiUtlis.cs                                                    |   21 +++
 HDL_ON/Entity/Function/SecurityAlarm.cs                                      |   12 +-
 HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/FirmwareUpdateView.cs                 |   63 ++++++++++
 HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs                  |    4 
 HDL_ON/HDL_ON.projitems                                                      |    2 
 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs                                      |    5 
 HDL-ON_iOS/Info.plist                                                        |    5 
 HDL-ON_iOS/Resources/Language.ini                                            |    4 
 HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs                    |    2 
 HDL_ON/DAL/Server/HttpUtil.cs                                                |    4 
 HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/SupportHomeKitNotesPage.cs            |   69 +++++++++++
 HDL_ON/Common/R.cs                                                           |    9 +
 HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs                        |   37 ++++++
 HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage_InstantaneousValue.cs |   62 +++++-----
 HDL_ON/DAL/Server/HttpServerRequest.cs                                       |    9 +
 SiriIntentsUI/SiriIntentsUI.csproj                                           |    2 
 SiriIntents/Server/HttpUtil.cs                                               |    4 
 20 files changed, 270 insertions(+), 61 deletions(-)

diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj
index 8dcc9a6..b6e7131 100644
--- a/HDL-ON_iOS/HDL-ON_iOS.csproj
+++ b/HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -38,8 +38,9 @@
         <WarningLevel>4</WarningLevel>
         <MtouchLink>SdkOnly</MtouchLink>
         <MtouchArch>x86_64</MtouchArch>
-<CodesignKey>iPhone Developer</CodesignKey>
+<CodesignKey>Apple Distribution: HDL Automation Co., Ltd (BVTA78PRYA)</CodesignKey>
 <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+<CodesignProvision>ComHdlOnProAdHoc20220117-1</CodesignProvision>
     </PropertyGroup>
     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
         <DebugSymbols>true</DebugSymbols>
@@ -73,6 +74,7 @@
         <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs>
         <MtouchI18n>cjk</MtouchI18n>
         <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+        <CodesignProvision>ComHdlOnProAdHoc20220117-1</CodesignProvision>
     </PropertyGroup>
     <ItemGroup>
         <Reference Include="System" />
diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist
index 0313fbb..63b2bdc 100644
--- a/HDL-ON_iOS/Info.plist
+++ b/HDL-ON_iOS/Info.plist
@@ -100,9 +100,9 @@
 	<key>UIStatusBarStyle</key>
 	<string>UIStatusBarStyleLightContent</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.5.402101241</string>
+	<string>1.5.402202171</string>
 	<key>CFBundleVersion</key>
-	<string>1.5.401241</string>
+	<string>1.5.402171</string>
 	<key>NSLocationWhenInUseUsageDescription</key>
 	<string>Use geographic location to provide services such as weather</string>
 	<key>NSAppleMusicUsageDescription</key>
@@ -120,6 +120,7 @@
 	<key>UIBackgroundModes</key>
 	<array>
 		<string>audio</string>
+		<string>location</string>
 		<string>voip</string>
 		<string>remote-notification</string>
 	</array>
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
index 67e559e..dbef30c 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -512,6 +512,8 @@
 524=Bypass
 525=Enable
 526=Cancel account
+527=Homekit support notes
+528=Firmware update
  
 1000=Room Humidity
 1001=V-chip
@@ -1647,6 +1649,8 @@
 524=鍋滅敤
 525=鍚敤
 526=娉ㄩ攢璐﹀彿
+527=鏀寔HomeKit璇存槑
+528=鍥轰欢鏇存柊
  
 1000=瀹ゅ唴婀垮害
 1001=绔ラ攣
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index e16185b..75c9bf3 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -153,10 +153,10 @@
                         MainPage.Log($"璇诲彇鎴块棿鏁版嵁澶辫触:Code:{roomResult.Code}; msg:{roomResult.message}");
                     }
                     //===================璁惧=======================
-                    var deviceResult = Ins.HttpRequest.GetDeviceList();
+                    var deviceResult = Ins.HttpRequest.GetDeviceList("30","1");
                     if (deviceResult.Code == StateCode.SUCCESS)
                     {
-                        endTime = DateTime.Now.AddSeconds(100);
+                        endTime = DateTime.Now.AddSeconds(5);
 
                         MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛");
                         var deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
@@ -164,6 +164,23 @@
                         {
                             deviceList = new DevcieApiPack();
                         }
+                        try
+                        {
+                            while (deviceList.totalPage != deviceList.pageNo)
+                            {
+                                var deviceResult2 = Ins.HttpRequest.GetDeviceList("30", Convert.ToInt32(deviceList.pageNo) + 1 + "");
+                                if (deviceResult2.Code == StateCode.SUCCESS)
+                                {
+                                    var deviceList2 = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
+                                    deviceList.pageNo = deviceList2.pageNo;
+                                    deviceList.list.AddRange(deviceList2.list);
+                                }
+                            }
+                        }catch(Exception ex)
+                        {
+
+                        }
+
                         string delFile = "";
                         if (FunctionList.List.GetDeviceFunctionList().Count > 0)
                         {
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index fb07c0f..a645c6e 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -4,7 +4,14 @@
 {
     public static class StringId
     {
-
+        /// <summary>
+        /// 鍥轰欢鏇存柊
+        /// </summary>
+        public const int FirmwareUpdate = 528;
+        /// <summary>
+        /// 鏀寔HomeKit璇存槑
+        /// </summary>
+        public const int SupportHomeKitNotes = 527;
         /// <summary>
         /// 娉ㄩ攢璐﹀彿
         /// </summary>
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 2414895..7c60903 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -1946,15 +1946,18 @@
         /// 鑾峰彇璁惧鍒楄〃
         /// </summary>
         /// <returns></returns>
-        public ResponsePackNew GetDeviceList()
+        public ResponsePackNew GetDeviceList(string pageSize="",string pageNo ="")
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             //d.Add("gatewayId", DB_ResidenceData.residenceData.HomeGateway.gatewayId);
             //d.Add("roomId", DB_ResidenceData.residenceData.residecenInfo.RegionID);//鍙帶鍙傛暟锛屽綋闇�瑕佸垎椤佃幏鍙栵紝鎬庝箞鐭ラ亾鍒嗛〉鎬绘暟
             //d.Add("searchType", DB_ResidenceData.residenceData.residecenInfo.RegionID);
-            //d.Add("pageSize", DB_ResidenceData.residenceData.residecenInfo.RegionID);
-            //d.Add("pageNo", DB_ResidenceData.residenceData.residecenInfo.RegionID);
+            if (!string.IsNullOrEmpty(pageSize))
+            {
+                d.Add("pageSize", pageSize);
+                d.Add("pageNo", pageNo);
+            }
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDevcieList, requestJson);
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index 6c692b6..315e9a2 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -17,8 +17,8 @@
         /// 鍥哄畾鍩熷悕,姝e紡鐜
         /// 鍏叡鍩熷悕灏辫繎瑙f瀽
         /// </summary>
-        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
-        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
+        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
         /// <summary>
         /// RegionMark
         /// </summary>
diff --git a/HDL_ON/Entity/Function/SecurityAlarm.cs b/HDL_ON/Entity/Function/SecurityAlarm.cs
index fa1a558..4ff0b58 100644
--- a/HDL_ON/Entity/Function/SecurityAlarm.cs
+++ b/HDL_ON/Entity/Function/SecurityAlarm.cs
@@ -474,11 +474,11 @@
     {
         /// <summary>
         /// 鎺у埗鐩爣绫诲瀷
-        /// 0:璁惧
-        /// 1:鍦烘櫙
-        /// 2:鑷姩鍖�
+        /// 1:璁惧
+        /// 2:鍦烘櫙
+        /// 3:鑷姩鍖�
         /// </summary>
-        public string target_type = "0";
+        public string target_type = "1";
         /// <summary>
         /// 杈撳嚭鐩爣鐨剆id
         /// </summary>
@@ -600,7 +600,7 @@
         public string StateText()
         {
             string text = "";
-            if (target_type == "0")
+            if (target_type == "1")
             {
                 switch (spk)
                 {
@@ -635,7 +635,7 @@
                         }
                         break;
                 }
-            }else if(target_type == "1")
+            }else if(target_type == "2")
             {
                 text = Language.StringByID(StringId.Open);
             }
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index 7961367..ba846b9 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -486,6 +486,8 @@
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\A31MusicFileList.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\A31SongPlay.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\MusicProperty.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AboutOn\SupportHomeKitNotesPage.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AboutOn\FirmwareUpdateView.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index 08fd54e..f6db906 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -163,12 +163,13 @@
 
                 btnLinkStateTip = new Button()
                 {
-                    X = Application.GetRealWidth(16),
-                    Y = Application.GetRealHeight(46),
-                    Width = Application.GetRealWidth(6),
-                    Height = Application.GetRealWidth(6),
+                    Y = Application.GetRealHeight(16),
+                    Height = Application.GetRealWidth(14),
                     BackgroundColor = CSS_Color.LinkTipFail,
                     Radius = (uint)Application.GetRealWidth(3),
+                    TextAlignment = TextAlignment.Center,
+                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    TextColor = CSS_Color.MainBackgroundColor,
                 };
                 topView.AddChidren(btnLinkStateTip);
                 //鏇存柊閾炬帴鐘舵�乮con棰滆壊
@@ -177,7 +178,7 @@
 
                 btnResidenceName = new Button()
                 {
-                    X = Application.GetRealWidth(26),
+                    X = Application.GetRealWidth(16),
                     Y = Application.GetRealHeight(32),
                     Width = Application.GetRealWidth(300),
                     Height = Application.GetRealHeight(33),
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
index f5198f6..d38ec13 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -199,13 +199,13 @@
             //Dome妯″紡
             if (MainPage.NoLoginMode)
             {
-                bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.MainColor;
                 return;
             }
 
             if (!Control.Ins.GatewayOnline_Local && !Control.Ins.GatewayOnline_Cloud)
             {
                 bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipFail;
+                bodyView.btnLinkStateTip.TextID = StringId.NetworkAnomaly;
             }
             else
             {
@@ -215,7 +215,8 @@
                 }
                 else
                 {
-                    bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.MainColor;
+                    bodyView.btnLinkStateTip.BackgroundColor = 0x00000000;
+                    bodyView.btnLinkStateTip.Text = "";
                 }
             }
         }
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs
index a9abca7..710917c 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs
@@ -184,6 +184,43 @@
             #endregion
             privacyPolicyView.GoAction = privacyPolicyAction;
             CheckIfNeedUpdateAsync();
+
+#if __IOS__
+            #region 鍥轰欢鍗囩骇
+            var firUpdateView = new ListCellView()
+            {
+                Y = privacyPolicyView.Bottom,
+            };
+            firUpdateView.BtnTilte.TextID = StringId.FirmwareUpdate;
+            bodyView.AddChidren(firUpdateView);
+            Action firmwareUpdateAction = () =>
+            {
+                var mPage = new HDL_ON.UI.UI2.PersonalCenter.AboutOn.FirmwareUpdateView();
+                MainPage.BasePageView.AddChidren(mPage);
+                mPage.ShowPage();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+            firUpdateView.GoAction = firmwareUpdateAction;
+            #endregion
+
+
+            #region HomeKit鏀寔璇存槑
+            var homeKitView = new ListCellView()
+            {
+                Y = firUpdateView.Bottom,
+            };
+            bodyView.AddChidren(homeKitView);
+            homeKitView.BtnTilte.TextID = StringId.SupportHomeKitNotes;
+            Action homeKitSupportViewAction = () => {
+                var mPage = new HDL_ON.UI.UI2.PersonalCenter.AboutOn.SupportHomeKitNotesPage();
+                MainPage.BasePageView.AddChidren(mPage);
+                mPage.ShowPage();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+            homeKitView.GoAction = homeKitSupportViewAction;
+            #endregion
+#endif
+
         }
 
 
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/FirmwareUpdateView.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/FirmwareUpdateView.cs
new file mode 100644
index 0000000..da10e26
--- /dev/null
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/FirmwareUpdateView.cs
@@ -0,0 +1,63 @@
+锘縰sing System;
+using HDL_ON.UI.CSS;
+using Shared;
+
+namespace HDL_ON.UI.UI2.PersonalCenter.AboutOn
+{
+    public class FirmwareUpdateView : FrameLayout
+    {
+        FirmwareUpdateView bodyView;
+        public FirmwareUpdateView()
+        {
+            bodyView = this;
+        }
+
+        public void ShowPage()
+        {
+            new TopViewDiv(bodyView, Language.StringByID(StringId.FirmwareUpdate)).LoadTopView();
+
+            var contentView = new VerticalScrolViewLayout()
+            {
+                X = Application.GetRealWidth(12),
+                Y = Application.GetRealHeight(90),
+                Height = bodyView.Height,
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+            };
+            bodyView.AddChidren(contentView);
+
+            var waitPage = new Loading();
+            bodyView.AddChidren(waitPage);
+            waitPage.Start();
+            new System.Threading.Thread(() =>
+            {
+                System.Threading.Thread.Sleep(2000);
+                Application.RunOnMainThread(() =>
+                {
+                    string msg = "";
+                    if (Language.CurrentLanguage == "Chinese")
+                    {
+                        msg = "褰撳墠鎵�鏈夎澶囧凡缁忔槸鏈�鏂板浐浠剁増鏈��";
+                    }
+                    else
+                    {
+                        msg = "Currently, all devices have the latest firmware version.";
+                    }
+                    var msgTv = new Button()
+                    {
+                        Text = msg,
+                        TextColor = CSS_Color.FirstLevelTitleColor,
+                        TextSize = CSS_FontSize.SubheadingFontSize,
+                        IsMoreLines = true,
+                        TextAlignment = TextAlignment.TopLeft
+                    };
+                    contentView.AddChidren(msgTv);
+                    waitPage.Hide();
+                    waitPage.RemoveFromParent();
+                });
+            }).Start();
+
+
+
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/SupportHomeKitNotesPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/SupportHomeKitNotesPage.cs
new file mode 100644
index 0000000..6c6bb36
--- /dev/null
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/SupportHomeKitNotesPage.cs
@@ -0,0 +1,69 @@
+锘縰sing System;
+using HDL_ON.UI.CSS;
+using Shared;
+
+namespace HDL_ON.UI.UI2.PersonalCenter.AboutOn
+{
+    public class SupportHomeKitNotesPage : FrameLayout
+    {
+        SupportHomeKitNotesPage bodyView;
+
+        public SupportHomeKitNotesPage()
+        {
+            bodyView = this;
+        }
+        public void ShowPage()
+        {
+            new TopViewDiv(bodyView, Language.StringByID(StringId.SupportHomeKitNotes)).LoadTopView();
+
+            var contentView = new VerticalScrolViewLayout()
+            {
+                Y = Application.GetRealHeight(90),
+                Height = bodyView.Height ,
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+            };
+            bodyView.AddChidren(contentView);
+
+            string msg = "";
+            if (Language.CurrentLanguage == "Chinese")
+            {
+                msg = "鐩墠HDL骞冲彴宸叉敮鎸佸悜鑻规灉搴旂敤鈥滃搴�滱pp 娣诲姞 HomeKit 閰嶄欢銆�" + "\r\n" +
+                        "鐩墠鏀寔娣诲姞鍒扳�滃搴�濈殑閰嶄欢鏈塇DL gateway銆丠DL light绛夈��" + "\r\n" +
+                        "鎮ㄥ彲浠ヤ娇鐢� iPhone銆乮Pad 鎴� iPod touch锛屾寜鐓т互涓嬫楠ゆ搷浣滐紝鍚戔�滃搴�滱pp 娣诲姞閰嶄欢锛�" + "\r\n" +
+                        "1銆佹墦寮�鈥滃搴�滱pp锛岀劧鍚庤交鐐光�滄坊鍔犻厤浠垛�� 鎴栤�滄坊鍔犫�濄��" + "\r\n" +
+                        "2銆佽交鐐光�滄坊鍔犻厤浠垛�濄��" + "\r\n" +
+                        "3銆佷娇鐢� iPhone銆乮Pad 鎴� iPod touch 涓婄殑鎽勫儚澶存壂鎻忛厤浠舵垨閰嶄欢鏂囩涓殑鍏綅 HomeKit 浠g爜鎴栦簩缁寸爜銆傚鏋滄偍浣跨敤鐨勬槸 iPhone 7 鎴栨洿鏂版満鍨嬶紝骞跺湪鎮ㄧ殑閰嶄欢涓婄湅鍒颁簡 NFC 鍏煎绗﹀彿锛岃灏嗘偍鐨� iPhone 闈犺繎杩欎釜閰嶄欢浠ヨ繘琛屾坊鍔犮��" + "\r\n" +
+                        "4銆佸湪閰嶄欢鍑虹幇鏃惰交鐐瑰畠銆傚鏋滅郴缁熻闂偍瑕佷笉瑕佲�滃皢閰嶄欢娣诲姞鍒扮綉缁溾�濓紝璇疯交鐐光�滃厑璁糕�濄��" + "\r\n" +
+                        "5銆佷负閰嶄欢鍛藉悕骞跺皢閰嶄欢鍒嗛厤缁欐煇涓埧闂达紝浠ュ崗鍔╂偍鍦ㄢ�滃搴�滱pp 涓瘑鍒畠鍜屼娇鐢� Siri 瀵瑰畠杩涜鎺у埗銆�" + "\r\n" +
+                        "6銆佽交鐐光�滀笅涓�姝モ�濓紝鐒跺悗杞荤偣鈥滃畬鎴愨�濄��";
+            }
+            else
+            {
+                msg = "At present, the HDL platform has supported adding homekit accessories to Apple's \"home\" app." + "\r\n" +
+                        "At present, HDL gateway, HDL light and other accessories can be added to \"home\"." + "\r\n" +
+                        "You can use iPhone, iPad or iPod touch to add accessories to the home app by following these steps: " + "\r\n" +
+                        "1.Open the home app and tap add accessories or add." + "\r\n" +
+                        "2.Tap add fitting." + "\r\n" +
+                        "3.Use the camera on iPhone, iPad or iPod touch to scan the eight digit homekit code or QR code in the accessory or accessory manuscript.If you are using iPhone 7 or later and see the NFC compatibility symbol on your accessory, please put your iPhone close to this accessory to add it." + "\r\n" +
+                        "4.Tap the accessory when it appears.If the system asks you whether you want to \"add accessories to the network\", tap \"allow\"." + "\r\n" +
+                        "5.Name the accessory and assign it to a room to help you identify it in the home app and use Siri to control it." + "\r\n" +
+                        "6.Tap next, then finish.";
+            }
+            var msgTv = new Button()
+            {
+                X = Application.GetRealWidth(35),
+                Y = Application.GetRealHeight(12),
+                Width = Application.GetRealWidth(300),
+                IsMoreLines = true,
+                Text = msg,
+                TextAlignment = TextAlignment.TopLeft,
+                TextColor = CSS_Color.TextualColor,
+                TextSize = CSS_FontSize.TextFontSize,
+            };
+            contentView.AddChidren(msgTv);
+
+
+        }
+
+    }
+}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs
index 83c900a..e1dd248 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs
@@ -157,7 +157,7 @@
                 tempStatus.Add(new SecurityOutputStatus() { key = FunctionAttributeKey.OnOff, value = "on" });
                 allocatedList.Add(new SecurityOutput
                 {
-                    target_type = "0",
+                    target_type = "1",
                     sid = function.sid,
                     status = tempStatus,
                     name = function.name,
@@ -184,7 +184,7 @@
                 tempStatus.Add(new SecurityOutputStatus() { key = "value", value = "0" });
                 allocatedList.Add(new SecurityOutput
                 {
-                    target_type = "1",
+                    target_type = "2",
                     sid = scene.sid,
                     status = tempStatus,
                     name = scene.name,
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs
index 96945a4..240cb13 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs
@@ -180,7 +180,7 @@
                     Text = function.GetAttrState("total_electricity"),
                     TextAlignment = TextAlignment.BottomLeft,
                 };
-                btnTotalElectricity.Width = btnTotalElectricity.GetTextWidth();
+                btnTotalElectricity.Width = btnTotalElectricity.GetTextWidth()+ Application.GetRealWidth(5);
                 controlView.AddChidren(btnTotalElectricity);
                 var btnTotalElectricityUnit = new Button()
                 {
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage_InstantaneousValue.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage_InstantaneousValue.cs
index 4abdef4..46c8fa3 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage_InstantaneousValue.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage_InstantaneousValue.cs
@@ -97,45 +97,47 @@
 
         public static void UpdataView(Function updata)
         {
-            if(bodyView!=null)
+            if (bodyView != null)
             {
-                for (int i = 0; i < bodyView.instantaneousValueView.ChildrenCount; i++)
+                Application.RunOnMainThread(() =>
                 {
-                    var view = bodyView.instantaneousValueView.GetChildren(i);
-                    if(null != view.Tag )
+                    for (int i = 0; i < bodyView.instantaneousValueView.ChildrenCount; i++)
                     {
-                        if (view.GetType() == typeof(InstantaneousValueView))
+                        var view = bodyView.instantaneousValueView.GetChildren(i);
+                        if (null != view.Tag)
                         {
-                           var view2 = view as InstantaneousValueView;
-                            switch (view.Tag.ToString())
+                            if (view.GetType() == typeof(InstantaneousValueView))
                             {
-                                case "active_power":
-                                    var attr = updata.GetAttribute("active_power");
-                                    if (attr != null)
-                                    {
-                                        view2.btnValue.Text = attr.curValue.ToString();
-                                    }
-                                    break;
-                                case "voltage":
-                                    var attr1 = updata.GetAttribute("voltage");
-                                    if (attr1 != null)
-                                    {
-                                        view2.btnValue.Text = attr1.curValue.ToString();
-                                    }
-                                    break;
-                                case "current":
-                                    var attr2 = updata.GetAttribute("current");
-                                    if (attr2 != null)
-                                    {
-                                        view2.btnValue.Text = attr2.curValue.ToString();
-                                    }
-                                    break;
+                                var view2 = view as InstantaneousValueView;
+                                switch (view.Tag.ToString())
+                                {
+                                    case "active_power":
+                                        var attr = updata.GetAttribute("active_power");
+                                        if (attr != null)
+                                        {
+                                            view2.btnValue.Text = attr.curValue.ToString();
+                                        }
+                                        break;
+                                    case "voltage":
+                                        var attr1 = updata.GetAttribute("voltage");
+                                        if (attr1 != null)
+                                        {
+                                            view2.btnValue.Text = attr1.curValue.ToString();
+                                        }
+                                        break;
+                                    case "current":
+                                        var attr2 = updata.GetAttribute("current");
+                                        if (attr2 != null)
+                                        {
+                                            view2.btnValue.Text = attr2.curValue.ToString();
+                                        }
+                                        break;
+                                }
                             }
                         }
                     }
-                }
+                });
             }
-
         }
     }
 
diff --git a/SiriIntents/Server/HttpUtil.cs b/SiriIntents/Server/HttpUtil.cs
index 56a78a0..f61de04 100644
--- a/SiriIntents/Server/HttpUtil.cs
+++ b/SiriIntents/Server/HttpUtil.cs
@@ -16,8 +16,8 @@
         /// 鍥哄畾鍩熷悕,姝e紡鐜
         /// 鍏叡鍩熷悕灏辫繎瑙f瀽
         /// </summary>
-        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
-        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
+        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
         /// <summary>
         /// RegionMark
         /// </summary>
diff --git a/SiriIntents/SiriIntents.csproj b/SiriIntents/SiriIntents.csproj
index 97110fe..a36210c 100644
--- a/SiriIntents/SiriIntents.csproj
+++ b/SiriIntents/SiriIntents.csproj
@@ -36,7 +36,7 @@
     <DefineConstants></DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <CodesignKey>iPhone Developer</CodesignKey>
+    <CodesignKey>iPhone Distribution</CodesignKey>
     <MtouchUseLlvm>true</MtouchUseLlvm>
     <MtouchFloat32>true</MtouchFloat32>
     <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
diff --git a/SiriIntentsUI/SiriIntentsUI.csproj b/SiriIntentsUI/SiriIntentsUI.csproj
index 111501c..da2da8b 100644
--- a/SiriIntentsUI/SiriIntentsUI.csproj
+++ b/SiriIntentsUI/SiriIntentsUI.csproj
@@ -37,7 +37,7 @@
     <DefineConstants></DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <CodesignKey>iPhone Developer</CodesignKey>
+    <CodesignKey>iPhone Distribution</CodesignKey>
     <MtouchUseLlvm>true</MtouchUseLlvm>
     <MtouchFloat32>true</MtouchFloat32>
     <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>

--
Gitblit v1.8.0