From 130a9b9cf4f5cd6ed8c11cb9cd4780f8b7da8bec Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 24 十二月 2020 23:17:59 +0800
Subject: [PATCH] Update ColorTureLampPageBLL.cs

---
 HDL_ON/DAL/Server/HttpServerRequest.cs |   56 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 44 insertions(+), 12 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 19c8c8a..5b5b29c 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -571,15 +571,14 @@
                             if (mHomeGatewayRes.Count > 0)
                             {
                                 DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];
-                                if (mHomeGatewayRes[0].gatewayStatus)
-                                {
-                                    //DriverLayer.Control.Ins.IsRemote = true;
-                                    DriverLayer.Control.Ins.GatewayOnline = true;
-                                }
-                                else
-                                {
-                                    DriverLayer.Control.Ins.GatewayOnline = false;
-                                }
+                                //if (mHomeGatewayRes[0].gatewayStatus)
+                                //{
+                                //    DriverLayer.Control.Ins.GatewayOnline = true;
+                                //}
+                                //else
+                                //{
+                                //    DriverLayer.Control.Ins.GatewayOnline = false;
+                                //}
                                 DB_ResidenceData.Instance.SaveResidenceData();
                                 return revertObj.Code;
                             }
@@ -615,8 +614,10 @@
                 var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<HomeGatewayInfo>(revertObj.Data.ToString());
                 if (mHomeGatewayRes != null)
                 {
-                    DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes;
-                    DB_ResidenceData.Instance.SaveResidenceData();
+                    if(mHomeGatewayRes.gatewayStatus)
+                    {
+                        DriverLayer.Control.Ins.GatewayOnline = true;
+                    }
                 }
             }
             return revertObj.Code;
@@ -1824,7 +1825,7 @@
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
-            d.Add("deviceId", function.deviceId);//DriverLayer.Control.Ins.GatewayId);
+            d.Add("deviceId", function.deviceId);
             d.Add("name", function.name);
             d.Add("collect", function.collect);
             d.Add("roomIds", function.roomIds);
@@ -1832,6 +1833,22 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
         }
+        /// <summary>
+        /// 鏇存柊璁惧缁戝畾鎴块棿淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew UpdataDevcieBindRoomInfo(Function function)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("deviceId", function.deviceId);
+            d.Add("roomIds", function.roomIds);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
+        }
+
+
         /// <summary>
         /// 璁惧缁戝畾鎴块棿
         /// </summary>
@@ -1930,6 +1947,21 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetSecneInfo, requestJson);
         }
+
+        /// <summary>
+        /// 鑾峰彇鍦烘櫙璇︽儏鍒楄〃
+        /// </summary>
+        /// <param name="seceneId">鍦烘櫙ID</param>
+        /// <returns></returns>
+        public ResponsePackNew GetSceneListInfo(List<string> seceneIds)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("userSceneIds", seceneIds);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetSecneInfo, requestJson);
+        }
+
         /// <summary>
         /// 娣诲姞鍦烘櫙
         /// </summary>

--
Gitblit v1.8.0