From cbc156bc38d8b8eae7aef60cb186ab2b52fa701f Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 16 七月 2024 13:59:56 +0800
Subject: [PATCH] 增加全部挂断

---
 HDL_ON/DAL/Server/HttpServerRequest.cs | 1060 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 1,017 insertions(+), 43 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 2414895..731c865 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -44,14 +44,19 @@
         /// <param name="qType">鏃堕棿鏌ヨ绫诲瀷锛歨our=杩�24灏忔椂銆亀eek=杩戜竴鍛ㄣ�乵onth = 杩戜竴鏈� </param>
         /// <param name="deviceId">璁惧ID</param>
         /// <param name="deviceKey">鍔熻兘鏌ヨ绫诲瀷锛歱m25</param>
+        /// <param name="time">鍏蜂綋鏌ヨ鐨勬棩鏈燂紝閲戣寕娓╂帶鍣ㄤ娇鐢�</param>
         /// <returns></returns>
-        public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey)
+        public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey, string time = "")
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("type", qType);
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceId", deviceId);
             d.Add("key", deviceKey);
+            if (time != "")
+            {
+                d.Add("time", time);
+            }
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson);
@@ -74,6 +79,30 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson);
         }
+        /// <summary>
+        /// 鑾峰彇闂ㄩ攣鍘嗗彶璁板綍
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="pageSize"></param>
+        /// <param name="pageNo"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetVideoDoorlockHistory(string deviceId, string pageSize, string pageNo)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("pageSize", pageSize);
+            d.Add("pageNo", pageNo);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson);
+        }
+
+
+
+
+
+
         /// <summary>
         /// 璇诲彇鏈�杩戜竴涓湀鐨勬暟鎹�
         /// </summary>
@@ -132,7 +161,7 @@
         /// 鍒锋柊Token
         /// </summary>
         /// <returns></returns>
-        public string RefreshToken()
+        public string RefreshToken(bool canRefresh = true)
         {
             var requestJson = HttpUtil.GetSignRequestJson(new RefreshTokenObj()
             {
@@ -143,6 +172,7 @@
             {
                 var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(revertObj.Data.ToString());
                 UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken;
+                UserInfo.Current.AccessToken = revertData.accessToken;
                 UserInfo.Current.RefreshToken = revertData.refreshToken;
                 UserInfo.Current.LastTime = DateTime.Now;
                 UserInfo.Current.SaveUserInfo();
@@ -153,6 +183,21 @@
                 sdm.RefreshToken = UserInfo.Current.RefreshToken;
 #endif
             }
+            else if (revertObj.Code == StateCode.PasswrodError)
+            {
+                UserInfo.Current.LastTime = DateTime.MinValue;
+            }
+#if __IOS__
+            else if (revertObj.Code == "10001")
+            {
+                if (canRefresh)
+                {
+                    UserInfo.Current.RefreshToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GRefreshToken);
+                    //UserInfo.Current.AccessToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken);
+                    RefreshToken(false);
+                }
+            }
+#endif
             return revertObj.Code;
         }
 
@@ -195,8 +240,6 @@
         }
 
         #region 娉ㄥ唽銆佺櫥褰曢儴鍒�
-
-
         /// <summary>
         /// 閫氱敤 鍙戦�侀獙璇佺爜鏂规硶
         /// </summary>
@@ -330,6 +373,20 @@
             }
             var requestJson = HttpUtil.GetSignRequestJson(requestObj);
             return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_ForgetPwd, requestJson);
+        }
+        /// <summary>
+        /// 淇敼瀵嗙爜
+        /// </summary>
+        /// <param name="loginPwd"></param>
+        /// <param name="loginNewPwd"></param>
+        /// <returns></returns>
+        public ResponsePackNew UpdataPassword(string loginPwd,string loginNewPwd)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("loginPwd", loginPwd);
+            d.Add("loginNewPwd", loginNewPwd);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Update_Pwd, requestJson);
         }
 
         /// <summary>
@@ -522,12 +579,19 @@
                 var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoRes>>(resultObj.Data.ToString());
                 if (homeList == null || homeList.Count == 0)
                 {
+                    if (DB_ResidenceData.Instance.CurrentRegion!=null && DB_ResidenceData.Instance.CurrentRegion.id != "")
+                    {
+                        Shared.Application.RunOnMainThread(() =>
+                        {
+                            MainPage.GoUserPage(false);
+                        });
+                    }
                 }
                 else
                 {
                     foreach (var home in homeList)
                     {
-                        if (home.isBindGateway)
+                        if (home.isBindGateway)//鏄惁缁戝畾缃戝叧
                         {
                             UserInfo.Current.regionList.Add(home);
                             //鏂扮粦瀹氱殑浣忓畢锛岀洿鎺ュ垏鎹㈠埌鏂颁綇瀹�
@@ -542,6 +606,10 @@
                     }
                     if (UserInfo.Current.regionList.Count == 0)
                     {
+                        Shared.Application.RunOnMainThread(() =>
+                        {
+                            MainPage.GoUserPage(false);
+                        });
                         return "null";
                     }
                     //-------濡傛灉璐﹀彿鏄娆$櫥褰�
@@ -641,8 +709,8 @@
                         {
                             if (mHomeGatewayRes.Count > 0)
                             {
-                                DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];
-                                DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus;
+                                DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];//缃戝叧鐘舵��
+                                HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus;
                                 DB_ResidenceData.Instance.SaveResidenceData();
                                 return revertObj.Code;
                             }
@@ -664,6 +732,34 @@
             }
         }
         /// <summary>
+        /// 鑾峰彇浣忓畢浜や粯閾炬帴
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetHouseDeliveryUrl()
+        {
+            var d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            var jsonString = HttpUtil.GetSignRequestJson(d);
+            var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.APi_Post_GetHoserDeliverUrl, jsonString);
+            return revertObj;
+        }
+        /// <summary>
+        /// 浣忓畢浜や粯鍥炴粴
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew RollBack()
+        {
+            var d = new Dictionary<string, object>();
+            d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("communityId", DB_ResidenceData.Instance.CurrentRegion.communityId);
+            d.Add("flowRecordContent", "onPro浜や粯鍥炴粴");
+            d.Add("projectFlowRecordActionEnum", "DELIVERY_ROLLBACK");
+            var jsonString = HttpUtil.GetSignRequestJson(d);
+            var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.APi_Post_UpdateProjectDebugStatus, jsonString);
+            return revertObj;
+        }
+
+        /// <summary>
         /// 鑾峰彇缃戝叧淇℃伅
         /// </summary>
         public string GetGatewayInfo()
@@ -680,7 +776,7 @@
                 var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<HomeGatewayInfo>(revertObj.Data.ToString());
                 if (mHomeGatewayRes != null)
                 {
-                    DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes.gatewayStatus;
+                    HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes.gatewayStatus;
                 }
             }
             return revertObj.Code;
@@ -704,7 +800,7 @@
         {
             var requestObj = new ChildDeleteObj()
             {
-                childAccountId = subaccount.childAccountId,
+                childId = subaccount.id,
                 homeId = subaccount.homeId
             };
             var requestJson = HttpUtil.GetSignRequestJson(requestObj);
@@ -719,12 +815,11 @@
         /// <returns></returns>
         public ResponsePackNew EditSubAccountNickName(string nickName, string childAccountId)
         {
-            var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj()
-            {
-                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
-                childAccountId = childAccountId,
-                nickName = nickName,
-            });
+            var d = new Dictionary<string, string>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("childId", childAccountId);
+            d.Add("nickName", nickName);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson);
 
         }
@@ -739,7 +834,7 @@
             var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj()
             {
                 homeId = DB_ResidenceData.Instance.CurrentRegion.id,
-                childAccountId = childAccountId,
+                childId = childAccountId,
                 isAllowCreateScene = isAllow,
             });
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson);
@@ -955,11 +1050,77 @@
         public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName)
         {
             //娣诲姞瀛愯处鍙�
-            var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.id, account = subAccount, nickName = nickName };
+            var requestObj = new ChildAddObj()
+            {
+                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
+                account = subAccount,
+                nickName = nickName
+            };
             var requestJson = HttpUtil.GetSignRequestJson(requestObj);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson);
-
         }
+        //v1.7鏇存柊鎺ュ彛
+        public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName,string faceUrl)
+        {
+            //娣诲姞瀛愯处鍙�
+
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("nickName", nickName);
+            if (!string.IsNullOrEmpty(subAccount))
+            {
+                d.Add("account", subAccount);
+            }
+            if (!string.IsNullOrEmpty(faceUrl))
+            {
+                d.Add("faceUrl", @"data:image/jpg;base64," + faceUrl);
+            }
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson);
+        }
+        /// <summary>
+        /// 鍒犻櫎鎴愬憳璐﹀彿浜鸿劯鏁版嵁
+        /// </summary>
+        /// <param name="subAccount"></param>
+        /// <param name="nickName"></param>
+        /// <param name="faceUrl"></param>
+        /// <returns></returns>
+        public ResponsePackNew DeleteMemberFace( string childId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("childId", childId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_RemoveFace, requestJson);
+        }
+        /// <summary>
+        /// 鏇存柊鎴愬憳璐﹀彿浜鸿劯鏁版嵁
+        /// </summary>
+        public ResponsePackNew UpdataMemberFace(string childId, string faceUrl)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("childId", childId);
+            d.Add("userFace", @"data:image/jpg;base64," + faceUrl);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_UpdateFace, requestJson);
+        }
+        /// <summary>
+        /// 瀹跺涵鎴愬憳缁戝畾璐﹀彿
+        /// </summary>
+        /// <param name="childId"></param>
+        /// <param name="faceUrl"></param>
+        /// <returns></returns>
+        public ResponsePackNew SubChildBindAccount(string childId, string account)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("childId", childId);
+            d.Add("account", account);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_BindAccount, requestJson);
+        }
+        
 
         /// <summary>
         /// 淇敼浣忓畢璋冭瘯鏉冮檺
@@ -1025,10 +1186,10 @@
 #endif
                 //鏄惁鐢熶骇妯″紡
                 bool isProduce = true;
-#if DEBUG
-                isProduce = false;
-#endif
-
+                if (HttpUtil.GlobalRequestHttpsHost == "https://test-gz.hdlcontrol.com")
+                {
+                    isProduce = false;
+                }
                 if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken))
                 {
                     Utlis.WriteLine("PushDeviceToken 涓虹┖");
@@ -1332,16 +1493,50 @@
         {
             var requestObj = new AppVersionCheckObj()
             {
-
+                
             };
+            #if __IOS__
+            requestObj.releaseSystem = "IOS";
+            #else
+            requestObj.releaseSystem = "Android";
+            #endif
 
             var requestJson = HttpUtil.GetSignRequestJson(requestObj);
             return HttpUtil.RequestHttpsPost(NewAPI.API_POST_CheckAppVersion, requestJson);
         }
-
-
-
         #endregion
+
+        #region 娉ㄩ攢璐﹀彿
+        /// <summary>
+        /// 鑾峰彇褰撳墠鐗堟湰娉ㄩ攢璐﹀彿妯″紡
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetUnregisterModel()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("version", MainPage.VersionString);
+            d.Add("appCode", "1588071238036582401");
+#if __IOS__
+            d.Add("releaseSystem", "IOS");
+#else
+            d.Add("releaseSystem", "Android");
+#endif
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_GetUnregisterModel, requestJson);
+        }
+        /// <summary>
+        /// 娉ㄩ攢璐﹀彿
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Unregister(string pwd)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("userId", UserInfo.Current.ID);
+            d.Add("pwd", pwd);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_Unregister, requestJson);
+        }
+#endregion
 
         #region 鑾峰彇澶╂皵閮ㄥ垎
         /// <summary>
@@ -1349,6 +1544,11 @@
         /// </summary>
         public void GetCityWeatherInfo(string lon, string lat)
         {
+            if (lon == "0" || lat == "0")
+                return;
+            MainPage.cityInfo.lon = lon;
+            MainPage.cityInfo.lat = lat;
+
             System.Threading.Tasks.Task.Run(() =>
             {
                 while (true)
@@ -1390,7 +1590,8 @@
                             MainPage.cityInfo.weather = jt.GetValue("Weather").ToString();
                             MainPage.cityInfo.lowestTemperature = jt.GetValue("lowestTemperature").ToString();
                             MainPage.cityInfo.highestTemperature = jt.GetValue("highestTemperature").ToString();
-
+                            MainPage.CityWeatherAction?.Invoke();
+                            HDL_ON.UI.HomePage.LoadEvent_RefreshAir();
                             break;
                         }
                         catch (Exception ex)
@@ -1398,16 +1599,8 @@
                             MainPage.Log($"get weather error : {ex.Message}");
                         }
                     }
-                    System.Threading.Thread.Sleep(1000);
+                    System.Threading.Thread.Sleep(5000);
                 }
-                Shared.Application.RunOnMainThread(() =>
-                {
-                    try
-                    {
-                        HDL_ON.UI.HomePage.LoadEvent_RefreshAir();
-                    }
-                    catch { }
-                });
             });
         }
         ///// <summary>
@@ -1943,18 +2136,33 @@
 
         #region Kaede --璁惧鍔熻兘鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��
         /// <summary>
+        /// 鑾峰彇涔愭瀛愯处鍙穞oken
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetLcSubAccountToken()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetLcSubToken, requestJson);
+        }
+        /// <summary>
         /// 鑾峰彇璁惧鍒楄〃
         /// </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);
@@ -1971,8 +2179,10 @@
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("productPlatform", productPlatform);
             d.Add("productBrand", productBrand);
-            if (productBrand != "MegaHealth")
+            if (productBrand == "MegaHealth" || productBrand == "IMOU")
             {
+            }
+            else { 
                 d.Add("networkConfig", true);
             }
 
@@ -2002,7 +2212,7 @@
         /// <param name="productPlatform"></param>
         /// <param name="productBrand"></param>
         /// <returns></returns>
-        public ResponsePackNew IndependentRegister3TyDevcie(string spk, string extDevId, string deviceName, string pairCode = "")
+        public ResponsePackNew IndependentRegister3TyDevcie(string spk, string extDevId, string deviceName,string productBrandIdentity, string pairCode = "")
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
@@ -2010,12 +2220,28 @@
             d.Add("extDevId", extDevId);
             d.Add("name", deviceName);
             d.Add("code", pairCode);
+            d.Add("productBrandIdentity", productBrandIdentity);
 
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson);
         }
 
+        /// <summary>
+        /// 鍒犻櫎绗笁鏂硅澶�
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Delete3tyDevice(string deviceId)
+        {
+
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var responsePackNew = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Remove3tyDevcie, requestJson);
+            return responsePackNew;
+        }
 
 
 
@@ -2073,7 +2299,7 @@
             d.Add("actions", actionObjs);
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
-            MainPage.Log($"api鍔熻兘鎺у埗锛歿requestJson}");
+            MainPage.Log($"api鍙戦�佹帶鍒讹細{requestJson}");
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlDevice, requestJson);
         }
         /// <summary>
@@ -2089,6 +2315,38 @@
             d.Add("name", function.name);
             d.Add("collect", function.collect);
             d.Add("roomIds", function.roomIds);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
+        }
+
+        /// <summary>
+        /// 缂栬緫璁惧淇℃伅
+        /// 缁戝畾鍏崇郴銆佸悕绉般�佹敹钘�
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew UpdataDevcieName(string deviceId,string name)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("name", name);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
+        }
+
+        /// <summary>
+        /// 缂栬緫璁惧淇℃伅
+        /// 缁戝畾鍏崇郴銆佸悕绉般�佹敹钘�
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew UpdataDevcieName(Function function,string name)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", function.deviceId);
+            d.Add("name", name);
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
@@ -2172,8 +2430,53 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectDevice, requestJson);
         }
+        /// <summary>
+        /// 璁惧鎵╁睍閰嶇疆
+        /// </summary>
+        public ResponsePackNew DeviceExtSet(string deviceId,ExtSet extSet)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId",  deviceId );
+            d.Add("extSet", extSet);
 
-        #endregion
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeviceExtSet, requestJson);
+        }
+        /// <summary>
+        /// 鑾峰彇璁惧娑堟伅瑙勫垯閰嶇疆
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetDeviceMessageRulesSet(string deviceId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDeviceMessageRulesSet, requestJson);
+        }
+        /// <summary>
+        /// 璁惧娑堟伅瑙勫垯閰嶇疆
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="conditionIdentify"></param>
+        /// <param name="push"></param>
+        /// <returns></returns>
+        public ResponsePackNew DeviceMessageRulesSet(string deviceId,string conditionIdentify,bool push)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("conditionIdentify", conditionIdentify);
+            d.Add("push", push);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeviceMessageRulesSet, requestJson);
+        }
+
+
+#endregion
 
         #region Kaede --鍦烘櫙鍔熻兘--------------------------
         /// <summary>
@@ -2566,6 +2869,91 @@
 
             return pack;
         }
+
+        /// <summary>
+        /// 鑾峰彇绗笁鏂瑰搧鐗屽垪琛╛Iot
+        /// </summary>
+        public ResponsePackNew Get3tyIotBrandList()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetBrandList_Iot, requestJson);
+
+            return pack;
+        }
+        /// <summary>
+        /// 鎼滅储绗笁鏂硅澶嘷iot
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Search3tyIotDevice(string companyId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("companyId", companyId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Search3tyIotDevice, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 鎼滅储绗笁鏂硅澶囧姛鑳藉垪琛╛iot
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Get3tyIotDeviceFunctionList(string companyId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("companyId", companyId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyIotFunction, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇绗笁鏂瑰钩鍙版敮鎸佺殑璁惧绫诲瀷鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Get3tyIotSupportSpkList(string companyId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("companyId", companyId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyIotFunction, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 璁剧疆绗笁鏂硅澶囩粦瀹氱殑浣忓畢
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Set3tyIotFunctionToHouse(List<string> deviceIds,string homeId, string companyId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("deviceIds", deviceIds);
+            d.Add("homeId", homeId);
+            d.Add("companyId", companyId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Setting3tyIotFunctionToHouse, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 瑙g粦绗笁鏂瑰钩鍙拌处鍙�
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Unbound3tyIotAccount(string companyId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("companyId", companyId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Unbound3tyIotAccount, requestJson);
+            return pack;
+        }
+
+
+
         /// <summary>
         /// 鑾峰彇缁戝畾鐨勭涓夋柟鍝佺墝鍒楄〃
         /// </summary>
@@ -2610,6 +2998,41 @@
             var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Check, requestJson);
             return pack;
         }
+        /// <summary>
+        /// 鑾峰彇闂ㄥ彛鏈哄緲寰婃姤璀︽暟鎹�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetAlarmRecords(string deviceId, int pageSize, int pageNo, string alarmType = "PROWLER_ALARM")
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("alarmType", alarmType);
+            d.Add("pageSize", pageSize);
+            d.Add("pageNo", pageNo);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_ALARM_RECORDS, requestJson);
+            return pack;
+
+        }
+
+        /// <summary>
+        /// 鑾峰彇绗笁鏂规敞鍐岀殑id
+        /// </summary>
+        /// <param homeId="homeId">浣忓畢id</param>
+        /// <returns></returns>
+        public ResponsePackNew GetExtUserId(string homeId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", homeId);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetExtUserId, requestJson);
+
+            return pack;
+        }
+
         #endregion
 
         #region 鈻� 闂ㄩ攣鐩稿叧____________________________
@@ -2680,8 +3103,382 @@
             //IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code);
             return listSortLog;
         }
+        /// <summary>
+        /// 鑾峰彇闂ㄩ攣涓存椂瀵嗙爜
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetDoorTempPassword(string deviceId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetTempPasswrod, requestJson);
+        }
+        /// <summary>
+        /// 鍒涘缓闂ㄩ攣涓存椂瀵嗙爜
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew CreateDoorTempPassword(string deviceId,string beginTime,string endTime)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("beginTime", beginTime);
+            d.Add("endTime", endTime);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CreateTempPasswrod, requestJson);
+        }
+        /// <summary>
+        /// 鍒犻櫎闂ㄩ攣涓存椂瀵嗙爜
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew DelDoorTempPassword(string deviceId, string pwdId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("pwdId", pwdId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DelTempPasswrod, requestJson);
+        }
+
+
+        #region 瑙嗛闂ㄩ攣  2023-07-07 16:47:20
+        /// <summary>
+        /// 鑾峰彇钀ょ煶闂ㄩ攣鐢ㄦ埛鍒楄〃
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetDoorlockUserList(string deviceId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDoorlockUserList, requestJson);
+        }
+
+        /// <summary>
+        /// 淇敼闂ㄩ攣鐢ㄦ埛澶囨敞
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew EditDoorlockUserName(string deviceId,string lockUserIndex,string remarkName)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("lockUserIndex", lockUserIndex);
+            d.Add("remarkName", remarkName);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_setDoorUserRemark, requestJson);
+        }
+
+        /// <summary>
+        /// 鍒犻櫎闂ㄩ攣鐢ㄦ埛鏁板瓧瀵嗙爜
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="lockUserIndex"></param>
+        /// <returns></returns>
+        public ResponsePackNew DeleteDoorlockUserNumberPassword(string deviceId, string lockUserIndex)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("lockUserIndex", lockUserIndex);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteDoorlockUser_NumberPassword, requestJson);
+        }
+
+        /// <summary>
+        /// 鍒犻櫎闂ㄩ攣鐢ㄦ埛鍗″瘑鐮�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="lockUserIndex"></param>
+        /// <returns></returns>
+        public ResponsePackNew DeleteDoorlockUserCardPassword(string deviceId, string lockUserIndex)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("lockUserIndex", lockUserIndex);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteDoorlockUser_DeleteCardPassword, requestJson);
+        }
+
+        /// <summary>
+        /// 鍒犻櫎闂ㄩ攣鐢ㄦ埛鎸囩汗瀵嗙爜
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="lockUserIndex"></param>
+        /// <returns></returns>
+        public ResponsePackNew DeleteDoorlockUserFingerPassword(string deviceId, string lockUserIndex)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("lockUserIndex", lockUserIndex);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteDoorlockUser_DeleteFingerPassword, requestJson);
+        }
+
+        /// <summary>
+        /// 鍒犻櫎闂ㄩ攣鐢ㄦ埛浜鸿劯瀵嗙爜
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="lockUserIndex"></param>
+        /// <returns></returns>
+        public ResponsePackNew DeleteDoorlockUserFacePassword(string deviceId, string lockUserIndex)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("lockUserIndex", lockUserIndex);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteDoorlockUser_DeleteFacePassword, requestJson);
+        }
+
+
+        /// <summary>
+        /// 鍒犻櫎闂ㄩ攣鐢ㄦ埛
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="lockUserIndex"></param>
+        /// <returns></returns>
+        public ResponsePackNew DeleteDoorlockUser(string deviceId, string lockUserIndex)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("lockUserIndex", lockUserIndex);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteDoorlockUser_DeleteUser, requestJson);
+        }
+
+        /// <summary>
+        /// 鏌ヨ鎸夐敭涓ゆ寮�闂�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetDoubleClickOpenDoorSwitch(string deviceId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDoubleClickOpenDoorSwitch, requestJson);
+        }
+        /// <summary>
+        /// 璁剧疆鎸夐敭涓ゆ寮�闂�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="enabled">鎸夐敭涓ゆ寮�闂ㄥ紑鍏� 0-鍏抽棴,1娆℃寜閿紑闂� 1-寮�鍚紝2娆℃寜閿紑闂�</param>
+        /// <returns></returns>
+        public ResponsePackNew SetDoubleClickOpenDoorSwitch(string deviceId,int enabled)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("enabled", enabled);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetDoubleClickOpenDoorSwitch, requestJson);
+        }
+
+        /// <summary>
+        /// 鏌ヨ绔ラ攣寮�鍏�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetChildLockSwitch(string deviceId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetChildLockSwitch, requestJson);
+        }
+        /// <summary>
+        /// 璁剧疆绔ラ攣寮�鍏�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="enabled">绔ラ攣寮�鍏� 0-鍏抽棴 1-寮�鍚�</param>
+        /// <returns></returns>
+        public ResponsePackNew SetChildLockSwitch(string deviceId, int enabled)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("enabled", enabled);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetChildLockSwitch, requestJson);
+        }
+
+
+        /// <summary>
+        /// 鏌ヨ鍙嶉攣閰嶇疆
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetAntiLockCfg(string deviceId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetAntiLockCfg, requestJson);
+        }
+        /// <summary>
+        /// 璁剧疆鍙嶉攣閰嶇疆
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="enabled"></param>
+        /// <returns></returns>
+        public ResponsePackNew SetAntiLockCfg(string deviceId, bool enabled)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("enabled", enabled);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetAntiLockCfg, requestJson);
+        }
+
+
+        /// <summary>
+        /// 鏌ヨ甯冩挙闃茬姸鎬�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetDefenceStatus(string deviceId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDefenceStatus, requestJson);
+        }
+        /// <summary>
+        /// 璁剧疆甯冩挙闃茬姸鎬�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="armStatus">甯冮槻鐘舵�� disarmed-鎾ら槻 armed-宸插竷闃�</param>
+        /// <param name="defenceMode">甯冮槻妯″紡 global-鍏ㄥ眬 atHome-鍦ㄥ outDoor-澶栧嚭 sleep-鐫$湢</param>
+        /// <returns></returns>
+        public ResponsePackNew SetDefenceStatus(string deviceId, bool defance)//,string defenceMode)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            if(defance)
+                d.Add("armStatus", "armed");
+            else
+                d.Add("armStatus", "disarmed");
+            d.Add("defenceMode", "global");
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetDefenceStatus, requestJson);
+        }
+
+        /// <summary>
+        /// 鏌ヨ浜鸿劯寮�閿侀厤缃�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetFaceUnlockCfg(string deviceId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetFaceRecognitionUnlockCfg, requestJson);
+        }
+        /// <summary>
+        /// 璁剧疆浜鸿劯寮�閿侀厤缃�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="enabled"></param>
+        /// <param name="mode">瑙i攣鏂瑰紡 0-鑷姩 1-鎵嬪姩</param>
+        /// <returns></returns>
+        public ResponsePackNew SetFaceUnlockCfg(string deviceId, bool enabled,int mode)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("enabled", enabled);
+            d.Add("mode", mode);//瑙i攣鏂瑰紡 0-鑷姩 1-鎵嬪姩
+            d.Add("sensitivity", 0);//鐏垫晱搴� 0-楂� 1-浣�
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetFaceRecognitionUnlockCfg, requestJson);
+        }
+
+        /// <summary>
+        /// 鏌ヨ闂ㄩ攣绯荤粺澹伴煶
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetDoorLockSystemSound(string deviceId)
+        {
+            var d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDoorLockSystemSound, requestJson);
+        }
+
+        /// <summary>
+        /// 璁剧疆闂ㄩ攣绯荤粺澹伴煶
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="sound"></param>
+        /// <returns></returns>
+        public ResponsePackNew SetDoorLockSystemSound(string deviceId,int sound)
+        {
+            var d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("sound", sound);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetDoorLockSystemSound, requestJson);
+        }
+
+        /// <summary>
+        /// 鏌ヨ闂ㄩ搩鎻愮ず闊�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetDoorBellTone(string deviceId)
+        {
+            var d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDoorBellTone, requestJson);
+        }
+
+        /// <summary>
+        /// 璁剧疆闂ㄩ搩鎻愮ず闊�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="volume"></param>
+        /// <returns></returns>
+        public ResponsePackNew SetDoorBellTone(string deviceId, int volume)
+        {
+            var d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("volume", volume);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetDoorBellTone, requestJson);
+        }
+
+
+
 
         #endregion
+
+        #endregion
+
         #region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________
         /// <summary>
         /// 鑾峰彇宸叉巿鏉冪殑闊崇鍒楄〃
@@ -2807,5 +3604,182 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetCustomerInfo, requestJson);
         }
+
+
+        #region 鍏変紡鍌ㄨ兘
+        /// <summary>
+        /// 鑾峰彇浣忓畢涓嬮�嗗彉鍣ㄥ垪琛�
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetInverterList()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetInverter_List, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇浣忓畢涓嬪厜浼忕粺璁$殑鏁版嵁
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetInverterStatisticsInfo()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetInverter_StatisticsInfo, requestJson);
+            return pack;
+        }
+        #endregion
+
+
+        #region 缇ゆ帶锛岀粍鍚堣皟鍏�
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶绫诲瀷
+        /// </summary>
+        /// <param name="spk"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetGroupControlTypes(string spk)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("spk", spk);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlTypes, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶鍒楄〃
+        /// </summary>
+        /// <param name="spk"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetGroupControlList()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶璇︽儏
+        /// </summary>
+        public ResponsePackNew GetGroupControInfo(string userDeviceGroupControlIds)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            var ids = new List<string>()
+            {
+                userDeviceGroupControlIds,
+            };
+            d.Add("userDeviceGroupControlIds", ids);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶璇︽儏
+        /// </summary>
+        public ResponsePackNew GetGroupControInfo(List<string> ids)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlIds", ids);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 娣诲姞缇ゆ帶鍒楄〃
+        /// </summary>
+        public ResponsePackNew AddGroupControl(List<GroupControl> groupControls)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+            d.Add("infos", groupControls);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddGroupControl, requestJson);
+            return pack;
+        }
+
+
+        /// <summary>
+        /// 娣诲姞缇ゆ帶鍒楄〃
+        /// </summary>
+        public ResponsePackNew DelGroupControl(string groupControlId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId });
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteGroupControl, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 缂栬緫缇ゆ帶鍒楄〃
+        /// </summary>
+        /// <param name="spk"></param>
+        /// <returns></returns>
+        public ResponsePackNew EditGroupControl(List<GroupControl> groupControls)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            //d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+            d.Add("infos", groupControls);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_UpdateGroupControl, requestJson);
+            return pack;
+        }
+
+
+        /// <summary>
+        /// 缇ゆ帶鎺у埗
+        /// </summary>
+        public ResponsePackNew ControlGroupControl(string userDeviceGroupControlId, Dictionary<string, object> pair)
+        {
+            var d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlId", userDeviceGroupControlId);
+            List<Dictionary<string, object>> dd = new List<Dictionary<string, object>>();
+            dd.Add(pair);
+            d.Add("status",dd);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlGroupControl, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 鏀惰棌缇ゆ帶
+        /// </summary>
+        public ResponsePackNew CollectGroupControl(string groupControlId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId });
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CollectGroupControl, requestJson);
+            return pack;
+        }
+
+
+        /// <summary>
+        /// 鍙栨秷鏀惰棌缇ゆ帶
+        /// </summary>
+        public ResponsePackNew CancelCollectGroupControl(string groupControlId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId });
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectGroupControl, requestJson);
+            return pack;
+        }
+
+        #endregion
+
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0