wxr
2021-05-12 9acd3887f1f8db40d59f991b1726a61aa7c7637c
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -49,9 +49,9 @@
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("type", qType);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceId", new List<string>() { deviceId });
            d.Add("key", new List<string>() { deviceKey });
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceId",  deviceId );
            d.Add("key",  "value" );
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson);
@@ -66,7 +66,7 @@
        public ResponsePackNew GetArmSensorHistory( string deviceId,string pageSize, string pageNo)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceId", deviceId);
            d.Add("pageSize", pageSize);
            d.Add("pageNo", pageNo);
@@ -465,33 +465,33 @@
            if (resultObj.Code == StateCode.SUCCESS)
            {
                UserInfo.Current.regionList = new List<RegionInfoRes>();
                var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoResNew>>(resultObj.Data.ToString());
                var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoRes>>(resultObj.Data.ToString());
                if (homeList == null || homeList.Count == 0)
                {
                }
                else
                {
                    foreach (var mHome in homeList)
                    foreach (var home in homeList)
                    {
                        var home = new RegionInfoRes()
                        {
                            RegionID = mHome.Id,
                            Name = mHome.homeName,
                            IsOthreShare = mHome.IsOtherShare,
                            accountType = mHome.accountType,
                            isRemoteControl = mHome.isRemoteControl,
                            isBindGateway = mHome.isBindGateway,
                            longitude = mHome.longitude,
                            latitude = mHome.latitude,
                            deliverstatus = mHome.deliverstatus,
                            homeType = mHome.homeType,
                            regionUrl = mHome.regionUrl,
                            emqUrl = mHome.emqUrl,
                            homeRegionName = mHome.homeRegionName,
                            homeRegionId = mHome.homeRegionId,
                            Address = mHome.homeAddress,
                            isAllowCreateScene = mHome.isAllowCreateScene,
                        };
                        //var home = new RegionInfoRes()
                        //{
                        //    RegionID = mHome.Id,
                        //    Name = mHome.homeName,
                        //    IsOthreShare = mHome.IsOtherShare,
                        //    accountType = mHome.accountType,
                        //    isRemoteControl = mHome.isRemoteControl,
                        //    isBindGateway = mHome.isBindGateway,
                        //    longitude = mHome.longitude,
                        //    latitude = mHome.latitude,
                        //    deliverstatus = mHome.deliverstatus,
                        //    homeType = mHome.homeType,
                        //    regionUrl = mHome.regionUrl,
                        //    emqUrl = mHome.emqUrl,
                        //    homeRegionName = mHome.homeRegionName,
                        //    homeRegionId = mHome.homeRegionId,
                        //    Address = mHome.homeAddress,
                        //    isAllowCreateScene = mHome.isAllowCreateScene,
                        //};
                        if (home.isBindGateway)
                        {
                            UserInfo.Current.regionList.Add(home);
@@ -502,7 +502,7 @@
                        return "null";
                    }
                    //-------如果账号是首次登录
                    if (DB_ResidenceData.Instance.CurrentRegion == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID))
                    if (DB_ResidenceData.Instance.CurrentRegion == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.id))
                    {
                        //刷新当前住宅
                        DB_ResidenceData.Instance.CurrentRegion = UserInfo.Current.regionList[0];
@@ -514,7 +514,7 @@
                    else
                    {
                        //住宅被删除
                        var findHome = UserInfo.Current.regionList.Find((obj) => obj.RegionID == DB_ResidenceData.Instance.CurrentRegion.RegionID);
                        var findHome = UserInfo.Current.regionList.Find((obj) => obj.id == DB_ResidenceData.Instance.CurrentRegion.id);
                        if (findHome == null)
                        {
                            Shared.Application.RunOnMainThread(() =>
@@ -556,7 +556,7 @@
        {
            var requestObj = new AddOrUpdateHomeObj()
            {
                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
            };
            if (editId == 0)
@@ -565,7 +565,7 @@
            }
            else if (editId == 1)
            {
                requestObj.Address = editName;
                requestObj.homeAddress = editName;
            }
            var requestJson = HttpUtil.GetSignRequestJson(requestObj);
@@ -579,14 +579,14 @@
        {
            try
            {
                if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) return "";
                var nowhomeId = DB_ResidenceData.Instance.CurrentRegion.RegionID;
                if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.id)) return "";
                var nowhomeId = DB_ResidenceData.Instance.CurrentRegion.id;
                var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = nowhomeId });
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_GetGatewayList, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
                {
                    var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HomeGatewayInfo>>(revertObj.Data.ToString());
                    if (nowhomeId == DB_ResidenceData.Instance.CurrentRegion.RegionID)
                    if (nowhomeId == DB_ResidenceData.Instance.CurrentRegion.id)
                    {
                        if (mHomeGatewayRes != null)
                        {
@@ -622,7 +622,7 @@
            if (DB_ResidenceData.Instance.HomeGateway == null)
                return StateCode.NETWORK_ERROR;
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
            var jsonString = HttpUtil.GetSignRequestJson(d);
            var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGatewayInfo, jsonString);
@@ -643,7 +643,7 @@
        /// <returns></returns>
        public ResponsePackNew GetResidenceMemberAccount()
        {
            var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID });
            var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.id });
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_FindAll, requestJson);
        }
@@ -672,7 +672,7 @@
        {
            var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj()
            {
                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
                childAccountId = childAccountId,
                nickName = nickName,
            });
@@ -689,7 +689,7 @@
        {
            var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj()
            {
                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
                childAccountId = childAccountId,
                isAllowCreateScene = isAllow,
            });
@@ -730,12 +730,13 @@
        {
            var requestJson = HttpUtil.GetSignRequestJson(new GetShareObj()
            {
                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
                childAccountId = childAccountId,
            });
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Share_GetList, requestJson);
        }
        #endregion
        ///// <summary>
@@ -869,26 +870,27 @@
        public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName)
        {
            //添加子账号
            var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID, 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);
        }
        ///// <summary>
        ///// 获取住宅下的成员账号信息
        ///// </summary>
        ///// <returns></returns>
        //public ResponsePack GetResidenceMemberAccountInfo(string account)
        //{
        //    Dictionary<string, object> d = new Dictionary<string, object>();
        //    d.Add("Account", account);
        //    string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
        //    return RequestHttps($"{severAddress}/ZigbeeUsers/GetSubAccountInfo", jsonString, true);
        //}
        /// <summary>
        /// 修改住宅调试权限
        /// </summary>
        /// <returns></returns>
        public ResponsePackNew ChangeResidenceDebugPerm(bool debugPerm)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("debugPerm", debugPerm);
            string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_Post_Home_UpdateDebugPerm, jsonString);
        }
        #endregion
        /// <summary>
@@ -1781,7 +1783,7 @@
        public ResponsePackNew GetDeviceList()
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            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);
@@ -1800,7 +1802,7 @@
        public ResponsePackNew Get3TyBrandBindDeviceList(string productPlatform, string productBrand)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("productPlatform", productPlatform);
            d.Add("productBrand", productBrand);
            d.Add("networkConfig", true);
@@ -1834,7 +1836,7 @@
        public ResponsePackNew GetDeviceInfo(string functionId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceIds", new List<string>() { functionId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1848,7 +1850,7 @@
        public ResponsePackNew GetDeviceInfoList(List<string> functionIds)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceIds", functionIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1861,7 +1863,7 @@
        public ResponsePackNew RefreshDeviceStatus(List<string> functionIds)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceIds", functionIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1876,11 +1878,12 @@
        public ResponsePackNew ControlDevice(List<ApiAlinkControlActionObj> actionObjs)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway == null ? "0" : DB_ResidenceData.Instance.HomeGateway.gatewayId);//DriverLayer.Control.Ins.GatewayId);
            d.Add("actions", actionObjs);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            MainPage.Log($"{requestJson}");
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlDevice, requestJson);
        }
        /// <summary>
@@ -1891,7 +1894,7 @@
        public ResponsePackNew UpdataDevcieInfo(Function function)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceId", function.deviceId);
            d.Add("name", function.name);
            d.Add("collect", function.collect);
@@ -1907,7 +1910,7 @@
        public ResponsePackNew UpdataDevcieBindRoomInfo(Function function)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceId", function.deviceId);
            d.Add("roomIds", function.roomIds);
@@ -1922,7 +1925,7 @@
        public ResponsePackNew BindDeviceToRoom(List<string> deviceIds,List<string> roomIds)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceIds", deviceIds);
            d.Add("roomIds", roomIds);
@@ -1935,7 +1938,7 @@
        public string UnbindDeviceToRoom(string deviceId, string roomId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceIds", new List<string>() { deviceId });
            d.Add("roomIds", new List<string>() { roomId });
@@ -1948,7 +1951,7 @@
        public string EditDeviceName(string deviceId, string deviceName)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceId", deviceId);
            d.Add("name", deviceName);
@@ -1961,7 +1964,7 @@
        public ResponsePackNew CollectDevice(string deviceId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceIds",new List<string>() { deviceId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1973,7 +1976,7 @@
        public ResponsePackNew CancelCollectDevice(string deviceId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceIds", new List<string>() { deviceId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1992,7 +1995,7 @@
        public ResponsePackNew GetSceneList(string roomId = null)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            if (roomId != null)
            {
                d.Add("roomId", roomId);
@@ -2036,7 +2039,7 @@
        public ResponsePackNew AddScene(Scene scene)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("scenes", new List<Scene>() { scene });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2054,7 +2057,7 @@
        public ResponsePackNew EditScene(Scene scene)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("scenes", new List<Scene>() { scene });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2067,7 +2070,7 @@
        public string DeleteScene(string userSceneId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("userSceneIds", new List<string>() { userSceneId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2080,7 +2083,7 @@
        public string ExecuteScene(string userSceneId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("userSceneIds", new List<string>() { userSceneId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2094,7 +2097,7 @@
        public string CollectScene(string userSceneId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("userSceneIds", new List<string>() { userSceneId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2108,7 +2111,7 @@
        public string CancelCollectScene(string userSceneId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("userSceneIds", new List<string>() { userSceneId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2125,7 +2128,7 @@
        public ResponsePackNew GetRoomList(string GetType = "All")
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            if (GetType != "All")
            {
                d.Add("roomType", GetType);
@@ -2144,7 +2147,7 @@
        public ResponsePackNew AddRoom(List<SpatialInfo> rooms)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("rooms", rooms);
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2163,7 +2166,7 @@
        public ResponsePackNew UpdateRoom(List<SpatialInfo> rooms)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("rooms", rooms);
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2183,7 +2186,7 @@
        public ResponsePackNew DeleteRoom(List<string> roomIds)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("ids", roomIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2194,7 +2197,173 @@
        #endregion
        #region Kaede --房间功能--------------------------
        #region Kaede -- 安防接口____________________________
        /// <summary>
        /// 获取安防列表
        /// </summary>
        public ResponsePackNew GetSecurityList()
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_List, requestJson);
            return pack;
        }
        /// <summary>
        /// 获取安防详情
        /// </summary>
        /// <param name="sidList">安防sid集合</param>
        /// <param name="userSecurityIds">安防云端id</param>
        /// <returns></returns>
        public ResponsePackNew GetSecurityInfo(List<string> sidList, List<string> userSecurityIds)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
            //sids userSecurityIds 不能同时为空
            d.Add("sids", sidList);
            d.Add("userSecurityIds", userSecurityIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Info, requestJson);
            return pack;
        }
        /// <summary>
        /// 添加安防
        /// </summary>
        public ResponsePackNew AddSecurity(List<SecurityAlarm> securities)
        {
            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("securitys", securities);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Add, requestJson);
            return pack;
        }
        /// <summary>
        /// 编辑安防
        /// </summary>
        public ResponsePackNew EditSecurity(List<SecurityAlarm> securities)
        {
            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("securitys", securities);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Edit, requestJson);
            return pack;
        }
        /// <summary>
        /// 删除安防
        /// </summary>
        /// <param name="sidList">安防sid</param>
        /// <param name="userSecurityIds">安防云端id</param>
        /// <returns></returns>
        public ResponsePackNew DeleteSecurity(List<string> sidList, List<string> userSecurityIds)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
            //sids userSecurityIds 不能同时为空
            d.Add("sids", sidList);
            d.Add("userSecurityIds", userSecurityIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Delete, requestJson);
            return pack;
        }
        /// <summary>
        /// 读取安防防区状态
        /// </summary>
        /// <param name="sidList">安防sid</param>
        /// <param name="userSecurityIds">安防云端id</param>
        /// <returns></returns>
        public ResponsePackNew ReadSecurityStatus(List<string> sidList, List<string> userSecurityIds)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
            //sids userSecurityIds 不能同时为空
            d.Add("sids", sidList);
            d.Add("userSecurityIds", userSecurityIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusRead, requestJson);
            return pack;
        }
        /// <summary>
        /// 设置安防防区状态
        /// </summary>
        public ResponsePackNew SetSecurityStatus(List<SecurityState> securityStates)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("securitys", securityStates);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusSet, requestJson);
            return pack;
        }
        /// <summary>
        /// 安防bypass设置
        /// </summary>
        public ResponsePackNew SetSecurityBypass(List<SecurityBypass> securityBypassStates)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("securitys", securityBypassStates);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_BypassSet, requestJson);
            return pack;
        }
        /// <summary>
        /// 安防bypass读取
        /// </summary>
        /// <param name="sidList">安防sid</param>
        /// <param name="userSecurityIds">安防云端id</param>
        /// <returns></returns>
        public ResponsePackNew ReadSecurityBypass(List<string> sidList, List<string> userSecurityIds)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
            //sids userSecurityIds 不能同时为空
            d.Add("sids", sidList);
            d.Add("userSecurityIds", userSecurityIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_BypassRead, requestJson);
            return pack;
        }
        /// <summary>
        /// 查询安防所有记录
        /// </summary>
        public ResponsePackNew GetSecurityLogList(string pageSize,string pageNo)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("pageSize", pageSize);
            d.Add("pageNo", pageNo);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_ListSecurityLog, requestJson);
            return pack;
        }
        /// <summary>
        /// 查询安防报警记录
        /// </summary>
        public ResponsePackNew GetSecurityAlarmLogList(string pageSize, string pageNo)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("pageSize", pageSize);
            d.Add("pageNo", pageNo);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_ListAlarmLog, requestJson);
            return pack;
        }
        #endregion
        #region Kaede --第三方品牌功能--------------------------
        /// <summary>
        /// 获取第三方品牌列表
        /// </summary>
@@ -2212,7 +2381,7 @@
        public ResponsePackNew Get3tyBindBrandList()
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetBindBrandList, requestJson);
@@ -2242,7 +2411,7 @@
        public ResponsePackNew CheckFlVideo()
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            var pack = HttpUtil.RequestHttpsPostFroHome( NewAPI.API_POST_FL_Check, requestJson);
            return pack;