wei
2020-12-15 7d9e5d946d08f0b53ff25d1c25dcf83efb68b734
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -59,7 +59,7 @@
            d.Add("QueryType", queryType);
            d.Add("loopId", loopId);
            d.Add("NowMonth", nowMonth);
            d.Add("MAC", DB_ResidenceData.residenceData.residenceGatewayMAC);
            d.Add("MAC", DB_ResidenceData.Instance.residenceGatewayMAC);
            d.Add("LocalTimeZone", 8);
            var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
            return RequestHttps("https://developer.hdlcontrol.com/api/GetSensorPushHistory", jsonString, true);
@@ -127,6 +127,18 @@
        #endregion
        /// <summary>
        /// 绑定调试人员提交的住宅,一个住宅只能绑定一次
        /// </summary>
        /// <returns></returns>
        public ResponsePackNew BindingResidence(string key)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            //d.Add("homeId", homeId);
            d.Add("secretKey", key);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_BindlingResidence, requestJson, HttpUtil.GlobalRequestHttpsHost);
        }
        #region 注册、登录部分
       
@@ -204,7 +216,7 @@
        /// <returns></returns>
        public ResponsePackNew ValidataCodeAndRegister(string account, string password, string code, bool isPhone = false)
        {
            var requestObj = new RegisterObj() { loginPwd = password, verifyCode = code, memberName = account };
            var requestObj = new RegisterObj() { loginPwd = password, verifyCode = code};//, memberName = account
            if (isPhone)
            {
                requestObj.memberPhone = account;
@@ -451,16 +463,13 @@
            var resultObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Gethomepager, requestJson);
            if (resultObj.Code == StateCode.SUCCESS)
            {
                UserInfo.Current.regionList = new List<RegionInfoRes>();
                var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoResNew>>(resultObj.Data.ToString());
                if (homeList == null || homeList.Count == 0)
                {
                }
                else
                {
                    UserInfo.Current.regionList = new List<RegionInfoRes>();
                    foreach (var mHome in homeList)
                    {
                        var home = new RegionInfoRes()
@@ -480,113 +489,51 @@
                            homeRegionId = mHome.homeRegionId,
                            Address = mHome.homeAddress,
                        };
                        if (home.IsOthreShare)
                        {
                            continue;
                        }
                        UserInfo.Current.regionList.Add(home);
                    }
                    if (string.IsNullOrEmpty(DB_ResidenceData.residenceData.CurReginID))
                    //-------如果账号是首次登录
                    if (DB_ResidenceData.Instance.CurrentRegion == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID))
                    {
                        DB_ResidenceData.residenceData.CurReginID = UserInfo.Current.regionList[0].RegionID;
                        //恢复备份
                        HDLCommon.Current.RestoreHomeBackup(DB_ResidenceData.residenceData.CurReginID);
                        //刷新当前住宅
                        DB_ResidenceData.Instance.CurrentRegion = UserInfo.Current.regionList[0];
                        DB_ResidenceData.Instance.SaveResidenceData();
                        UserInfo.Current.SaveUserInfo();
                        //刷新一次住宅网关
                        GetHomeGatewayList();
                    }
                    else
                    {
                        var curRegion = UserInfo.Current.regionList.Find((obj) => obj.RegionID == DB_ResidenceData.residenceData.CurReginID);
                        if(curRegion == null)
                        //住宅被删除
                        var findHome = UserInfo.Current.regionList.Find((obj) => obj.RegionID == DB_ResidenceData.Instance.CurrentRegion.RegionID);
                        if (findHome == null)
                        {
                            DB_ResidenceData.residenceData.CurReginID = UserInfo.Current.regionList[0].RegionID;
                            //恢复备份
                            HDLCommon.Current.RestoreHomeBackup(DB_ResidenceData.residenceData.CurReginID);
                            Shared.Application.RunOnMainThread(() =>
                            {
                                DB_ResidenceData.Instance.CurrentRegion = UserInfo.Current.regionList[0];
                                GetHomeGatewayList();
                                DB_ResidenceData.Instance.SaveResidenceData();
                                UserInfo.Current.SaveUserInfo();
                                Action action = () =>
                                {
                                    MainPage.GoUserPage();
                                };
                                new UI.PublicAssmebly().TipMsg(StringId.Tip, StringId.ResidenceDeletedSwitchToAnotherResidence, action);
                            });
                        }
                        else
                        {
                            //刷新当前住宅
                            DB_ResidenceData.Instance.CurrentRegion = findHome;
                            DB_ResidenceData.Instance.SaveResidenceData();
                            UserInfo.Current.SaveUserInfo();
                            //刷新一次住宅网关
                            GetHomeGatewayList();
                        }
                    }
                    DB_ResidenceData.residenceData.SaveResidenceData();
                    UserInfo.Current.SaveUserInfo();
                    //刷新一次住宅网关
                    GetHomeGatewayList();
                }
            }
            return resultObj.Code;
            //string jsonString = "{" +
            //                    "\"RequestVersion\":" + "\"" + MainPage.VersionString + "\"" + "," +
            //                    "\"RequestSource\":" + "\"" + "2" + "\"" + "," +
            //                    "\"HomeType\":" + "\"" + "1" + "\"" + "," +
            //                    "\"LoginAccessToken\":" + "\"" +  UserInfo.Current.loginTokenString + "\"" +
            //                    "}";
            //var responsePack = RequestHttps($"{severAddress}/App/GetHomePager", jsonString, false);
            //if (responsePack.StateCode.ToUpper() == StateCode.SUCCESS_CODE)
            //{
            //    var dataStr = JObject.FromObject(responsePack.ResponseData);
            //    //没有住宅
            //    if (dataStr.GetValue("PageData").ToString() == "[]")
            //    {
            //    }
            //    else
            //    {
            //        //{
            //        // {
            //        //  "Id": "1107487",
            //        //  "HomeStatus": 2,
            //        //  "UserGuid": "22980",
            //        //  "Name": "啊",
            //        //  "Address": null,
            //        //  "Longitude": 0.0,
            //        //  "Latitude": 0.0,
            //        //  "RegionName": null,
            //        //  "Company": null,
            //        //  "ContactPerson": null,
            //        //  "ContactPersonPhone": null,
            //        //  "Remarks": null,
            //        //  "ChangeDate": null,
            //        //  "AccountType": 0,
            //        //  "CreatedOnUtc": "2020-05-27T06:52:03",
            //        //  "IsOthreShare": false,
            //        //  "MainUserDistributedMark": null,
            //        //  "HomeGateways": [
            //        //    {
            //        //      "GatewayUniqueId": "4E47323347591243"
            //        //    }
            //        //  ]
            //        //}}
            //         UserInfo.Current.regionList = new List<RegionInfoRes>();
            //        foreach (var jsonData in dataStr.GetValue("PageData"))
            //        {
            //            var homeJsonStr = JObject.FromObject(jsonData);
            //            var home = new RegionInfoRes()
            //            {
            //                RegionID = homeJsonStr.GetValue("Id").ToString(),
            //                RegionName = homeJsonStr.GetValue("RegionName").ToString(),
            //                Name = homeJsonStr.GetValue("Name").ToString(),
            //                Address = homeJsonStr.GetValue("Address").ToString(),
            //                IsOthreShare = (bool)homeJsonStr.GetValue("IsOthreShare"),
            //                homeGateways = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HomeGateways>>(homeJsonStr.GetValue("HomeGateways").ToString()),
            //            };
            //            if (home.IsOthreShare)
            //            {
            //                continue;
            //            }
            //             UserInfo.Current.regionList.Add(home);
            //            if (string.IsNullOrEmpty(DB_ResidenceData.residenceData.CurReginID))
            //            {
            //                DB_ResidenceData.residenceData.CurReginID =  UserInfo.Current.regionList[0].RegionID;
            //            }
            //        }
            //        DB_ResidenceData.residenceData.SaveResidenceData();
            //         UserInfo.Current.SaveUserInfo();
            //    }
            //}
            //return responsePack.StateCode;
        }
        /// <summary>
@@ -599,7 +546,7 @@
        {
            var requestObj = new AddOrUpdateHomeObj()
            {
                homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID,
                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
            };
            if (editId == 0)
@@ -622,32 +569,32 @@
        {
            try
            {
                if (string.IsNullOrEmpty(DB_ResidenceData.residenceData.residecenInfo.RegionID)) return;
                var nowhomeId = DB_ResidenceData.residenceData.residecenInfo.RegionID;
                if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) return;
                var nowhomeId = DB_ResidenceData.Instance.CurrentRegion.RegionID;
                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.residenceData.residecenInfo.RegionID)
                    if (nowhomeId == DB_ResidenceData.Instance.CurrentRegion.RegionID)
                    {
                        if (mHomeGatewayRes != null)
                        {
                            if (mHomeGatewayRes.Count > 0)
                            {
                                DB_ResidenceData.residenceData.HomeGateway = mHomeGatewayRes[0];
                                DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];
                                if(mHomeGatewayRes[0].gatewayStatus == "ON_LINE")
                                {
                                    DriverLayer.Control.Ins.IsRemote = true;
                                    DriverLayer.Control.Ins.GatewayOnline = true;
                                }
                                DB_ResidenceData.residenceData.SaveResidenceData();
                                DB_ResidenceData.Instance.SaveResidenceData();
                                return;
                            }
                        }
                        //其余情况清空网关信息
                        DB_ResidenceData.residenceData.HomeGateway = null;
                        DB_ResidenceData.residenceData.SaveResidenceData();
                        DB_ResidenceData.Instance.HomeGateway = null;
                        DB_ResidenceData.Instance.SaveResidenceData();
                    }
                }
                else
@@ -667,7 +614,7 @@
        /// <returns></returns>
        public ResponsePackNew GetResidenceMemberAccount()
        {
            var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID });
            var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID });
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_FindAll, requestJson);
        }
@@ -696,7 +643,7 @@
        {
            var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj()
            {
                homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID,
                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
                childAccountId = childAccountId,
                nickName = nickName,
            });
@@ -713,7 +660,7 @@
        {
            var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj()
            {
                homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID,
                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
                childAccountId = childAccountId,
                isAllowCreateScene = isAllow,
            });
@@ -754,7 +701,7 @@
        {
            var requestJson = HttpUtil.GetSignRequestJson(new GetShareObj()
            {
                homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID,
                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
                childAccountId = childAccountId,
            });
@@ -893,7 +840,7 @@
        public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName)
        {
            //添加子账号
            var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.residenceData.residecenInfo.RegionID, account = subAccount, nickName = nickName };
            var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID, account = subAccount, nickName = nickName };
            var requestJson = HttpUtil.GetSignRequestJson(requestObj);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson);
@@ -927,7 +874,7 @@
                    attachClientId = attachClientId,
                    homeType = HomeTypeEnum.BUSPRO.ToString()
                });
                var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_GetMqttRemoteInfo, requestJson, DB_ResidenceData.residenceData.residecenInfo.regionUrl);
                var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_GetMqttRemoteInfo, requestJson, DB_ResidenceData.Instance.CurrentRegion.regionUrl);
                if (revertObj.Code == StateCode.SUCCESS)
                {
                    return Newtonsoft.Json.JsonConvert.DeserializeObject<MqttInfo>(revertObj.Data.ToString());
@@ -962,15 +909,15 @@
                isProduce = false;
#endif
                if (string.IsNullOrEmpty(UserInfo.Current.PushDeviceToken)) {
                if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken)) {
                    Utlis.WriteLine("PushDeviceToken 为空");
                    return false;
                }
                var mAddpushinfoObj = new AddpushinfoObj()
                {
                    pushToken = UserInfo.Current.PushDeviceToken,
                    deviceName = UserInfo.Current.PhoneName,
                    pushToken = OnAppConfig.Instance.PushDeviceToken,
                    deviceName = OnAppConfig.Instance.PhoneName,
                    deviceType = deviceType,
                    produce = isProduce,
                };
@@ -985,8 +932,8 @@
                        var pushId = revertObj.Data.ToString();
                        if (!string.IsNullOrEmpty(pushId))
                        {
                            UserInfo.Current.PushId = pushId;
                            UserInfo.Current.SaveUserInfo();
                            OnAppConfig.Instance.PushId = pushId;
                            OnAppConfig.Instance.SaveConfig();
                            Utlis.WriteLine("PushId: " + pushId);
                           
                            return true;
@@ -1031,7 +978,7 @@
            var requestJson = HttpUtil.GetSignRequestJson(new GetMessageListObj()
            {
                pushId = UserInfo.Current.PushId,
                pushId = OnAppConfig.Instance.PushId,
                pushType = pushType
            });
            return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Getpushmessagelist, requestJson);
@@ -1043,11 +990,11 @@
        /// <returns></returns>
        public bool PushSerivceClearmessagelist()
        {
            if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false;
            if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false;
            var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj()
            {
                pushId = UserInfo.Current.PushId
                pushId = OnAppConfig.Instance.PushId
            });
            var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Clearmessagelist, requestJson);
@@ -1068,11 +1015,11 @@
        /// <returns></returns>
        public bool PushSerivceSignOut()
        {
            if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false;
            if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false;
            try
            {
                var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() {
                    pushId = UserInfo.Current.PushId
                    pushId = OnAppConfig.Instance.PushId
                });
               
                var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_DeleteToken, requestJson);
@@ -1099,13 +1046,13 @@
        /// <returns></returns>
        public bool PushSerivceMarkAllMessageRead()
        {
            if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false;
            if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false;
            try
            {
                var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj()
                {
                    pushId = UserInfo.Current.PushId
                    pushId = OnAppConfig.Instance.PushId
                });
                var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_ALLMarkread, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
@@ -1131,7 +1078,7 @@
        /// <returns></returns>
        public bool PushSerivceMarkMessageRead(string msgId)
        {
            if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false;
            if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false;
            try
            {
@@ -1164,7 +1111,7 @@
        /// <returns></returns>
        public bool PushSerivceDeleteMessage(string msgId)
        {
            if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false;
            if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false;
            try
            {
@@ -1254,12 +1201,8 @@
        #region 获取天气部分
        /// <summary>
        /// /// <summary>
        /// 获取指定经纬度的城市信息
        /// </summary>
        /// </summary>
        /// <param name="lon">经度</param>
        /// <param name="lat">纬度</param>
        public void GetCityInfo(string lon, string lat)
        {
            System.Threading.Tasks.Task.Run(() =>
@@ -1806,8 +1749,8 @@
        public ResponsePackNew GetDeviceList()
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("gatewayId", DB_ResidenceData.residenceData.HomeGateway.gatewayId);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            //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);
@@ -1823,7 +1766,7 @@
        public ResponsePackNew GetDeviceInfoList(List<string> functionIds)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceIds", functionIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1836,7 +1779,7 @@
        public ResponsePackNew RefreshDeviceStatus(List<string> functionIds)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceIds", functionIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1850,8 +1793,8 @@
        public ResponsePackNew ControlDevice(List<ApiAlinkControlActionObj> actionObjs)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("gatewayId", DB_ResidenceData.residenceData.HomeGateway.gatewayId);//DriverLayer.Control.Ins.GatewayId);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);//DriverLayer.Control.Ins.GatewayId);
            d.Add("actions", actionObjs);
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1865,8 +1808,8 @@
        public ResponsePackNew UpdataDevcieInfo(Function function)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("gatewayId", DB_ResidenceData.residenceData.HomeGateway.gatewayId);//DriverLayer.Control.Ins.GatewayId);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceId", function.deviceId);//DriverLayer.Control.Ins.GatewayId);
            d.Add("name", function.name);
            d.Add("collect", function.collect);
            d.Add("roomIds", function.roomIds);
@@ -1877,15 +1820,15 @@
        /// <summary>
        /// 设备绑定房间
        /// </summary>
        public string BindDeviceToRoom(string deviceId,string roomId)
        public ResponsePackNew BindDeviceToRoom(List<string> deviceIds,List<string> roomIds)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("deviceIds", new List<string>() { deviceId});
            d.Add("roomIds", new List<string>() { roomId});
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceIds", deviceIds);
            d.Add("roomIds", roomIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_BindDeviceToRoom, requestJson).Code;
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_BindDeviceToRoom, requestJson);
        }
        /// <summary>
        /// 设备解绑房间
@@ -1893,7 +1836,7 @@
        public string UnbindDeviceToRoom(string deviceId, string roomId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceIds", new List<string>() { deviceId });
            d.Add("roomIds", new List<string>() { roomId });
@@ -1906,7 +1849,7 @@
        public string EditDeviceName(string deviceId, string deviceName)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceId", deviceId);
            d.Add("name", deviceName);
@@ -1919,7 +1862,7 @@
        public ResponsePackNew CollectDevice(string deviceId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceIds",new List<string>() { deviceId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1931,7 +1874,7 @@
        public ResponsePackNew CancelCollectDevice(string deviceId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceIds", new List<string>() { deviceId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1950,7 +1893,7 @@
        public ResponsePackNew GetSceneList(string roomId = null)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            if (roomId != null)
            {
                d.Add("roomId", roomId);
@@ -1979,7 +1922,7 @@
        public ResponsePackNew AddScene(Scene scene)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("scenes", new List<Scene>() { scene });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1993,7 +1936,7 @@
        public ResponsePackNew EditScene(Scene scene)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("scenes", new List<Scene>() { scene });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2006,7 +1949,7 @@
        public string DeleteScene(string userSceneId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("userSceneIds", new List<string>() { userSceneId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2019,7 +1962,7 @@
        public string ExecuteScene(string userSceneId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("userSceneIds", new List<string>() { userSceneId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2033,7 +1976,7 @@
        public string CollectScene(string userSceneId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("userSceneIds", new List<string>() { userSceneId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2047,7 +1990,7 @@
        public string CancelCollectScene(string userSceneId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("userSceneIds", new List<string>() { userSceneId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2064,7 +2007,7 @@
        public ResponsePackNew GetRoomList(string GetType = "All")
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            if (GetType != "All")
            {
                d.Add("roomType", GetType);
@@ -2082,7 +2025,7 @@
        public ResponsePackNew AddRoom(List<SpatialInfo> rooms)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("rooms", rooms);
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2101,7 +2044,7 @@
        public ResponsePackNew UpdateRoom(List<SpatialInfo> rooms)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("rooms", rooms);
            var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2121,7 +2064,7 @@
        public ResponsePackNew DeleteRoom(List<string> roomIds)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.residenceData.residecenInfo.RegionID);
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("ids", roomIds);
            var requestJson = HttpUtil.GetSignRequestJson(d);