From af1cb3ecd0f4b0589e00b28f7f9edccf39e6e12b Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 10 九月 2020 16:15:11 +0800
Subject: [PATCH] 202009101

---
 HDL_ON/DAL/Server/HttpServerRequest.cs |  271 ++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 182 insertions(+), 89 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 0edacba..212ca9f 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -38,11 +38,36 @@
 
         public HttpServerRequest()
         {
-#if DEBUG1
-            severAddress = debugSever;
-#else
             severAddress = relaseaSever;
-#endif
+        }
+
+        /// <summary>
+        /// 鑾峰彇浼犳劅鍣ㄥ巻鍙叉暟鎹�
+        /// </summary>
+        /// <param name="subnetId"></param>
+        /// <param name="deviceId"></param>
+        /// <param name="bigClass"></param>
+        /// <param name="minClass"></param>
+        /// <param name="queryType"></param>
+        /// <param name="loopId"></param>
+        /// <param name="nowMonth"></param>
+        /// <param name="mac"></param>
+        /// <returns></returns>
+        public ResponsePack GetSensorHistory(int subnetId,int deviceId,int bigClass,int minClass,int queryType,int loopId,int nowMonth,string mac)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("SubnetID", subnetId);
+            d.Add("DeviceID", deviceId);
+            d.Add("LargeType", bigClass);
+            d.Add("SmallType", minClass);
+            d.Add("QueryType", queryType);
+            d.Add("loopId", loopId);
+            d.Add("NowMonth", nowMonth);
+            d.Add("MAC", DB_ResidenceData.residenceData.residenceGatewayMAC);
+            d.Add("LocalTimeZone", 8);
+            var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
+            return RequestHttps("https://developer.hdlcontrol.com/api/GetSensorPushHistory", jsonString,true);
+
         }
 
         public string GetRequestResultMsg(string resultCode)
@@ -60,7 +85,7 @@
                     result = Language.StringByID(StringId.FailedToSendVerificationCode);
                     break;
                 case "EXIST":
-                    result = Language.StringByID(StringId.AccountAlreadyExists);
+                    result = Language.StringByID(StringId.AccountAlreadyUse);
                     break;
                 case "Self:Net_Error":
                     result = Language.StringByID(StringId.NetworkAnomaly);
@@ -68,7 +93,6 @@
             }
             return result;
         }
-
 
 
         #region 娉ㄥ唽銆佺櫥褰曢儴鍒�
@@ -150,7 +174,7 @@
         /// <summary>
         /// 鑾峰彇娉ㄥ唽楠岃瘉鐮�
         /// </summary>
-        public ResponsePack GetPhoneRegisterVerCode(string account)
+        public ResponsePack GetRegisterVerCode(string account)
         {
             string jsonString = "{" +
                                 "\"Account\":" + "\"" + account + "\"" + "," +
@@ -168,30 +192,29 @@
         /// <summary>
         /// 鑾峰彇鐧诲綍楠岃瘉鐮�
         /// </summary>
-        /// <param name="phoneNum">鎵嬫満鍙风爜</param>
-        public ResponsePack GetPhoneLoginVerCode(string phoneNum)
+        public ResponsePack GetLoginVerCode(string account)
         {
 
             string jsonString = "{" +
-                                "\"Account\":" + "\"" + phoneNum + "\"" + "," +
+                                "\"Account\":" + "\"" + account + "\"" + "," +
                                 "\"AreaCode\":" + "86" + 
                                 "}";
             return RequestHttps($"{severAddress}/ZigbeeUsers/LoginSendVerCode", jsonString, false);
         }
 
-        /// <summary>
-        /// 鍙戦�侀獙璇佺爜
-        /// </summary>
-        public ResponsePack SendSms(string account)
-        {
-            string jsonString = "{" +
-                                "\"Account\":" + "\"" + account + "\"" + "," +
-                                "\"Company\":" + MainPage.Company + "," +
-                                "\"Language\":" + "\"" + Language.CurrentLanguage + "\"" + "," +
-                                "\"AreaCode\":" + OnAppConfig.Instance.CountryNumber +
-                                "}";
-            return RequestHttps($"{severAddress}/ZigbeeUsers/LoginSendVerCode", jsonString, false);
-        }
+        ///// <summary>
+        ///// 鍙戦�侀獙璇佺爜
+        ///// </summary>
+        //public ResponsePack SendSms(string account)
+        //{
+        //    string jsonString = "{" +
+        //                        "\"Account\":" + "\"" + account + "\"" + "," +
+        //                        "\"Company\":" + MainPage.Company + "," +
+        //                        "\"Language\":" + "\"" + Language.CurrentLanguage + "\"" + "," +
+        //                        "\"AreaCode\":" + OnAppConfig.Instance.CountryNumber +
+        //                        "}";
+        //    return RequestHttps($"{severAddress}/ZigbeeUsers/LoginSendVerCode", jsonString, false);
+        //}
 
         /// <summary>
         /// 楠岃瘉楠岃瘉鐮�
@@ -247,21 +270,17 @@
                 try
                 {
                     var headImageString = dataStr.GetValue("HeadImage").ToString();
-                    var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(headImageString);
-                    var headImageBytes = Newtonsoft.Json.JsonConvert.DeserializeObject<byte[]>(jsonString);
-                    MainPage.LoginUser.headImagePageBytes = headImageBytes;
-                    var filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/", "headImage.png");
-
-#if DEBUG
-                    Application.RunOnMainThread(() =>
+                    if (!string.IsNullOrEmpty(headImageString))
                     {
-                        new Tip() { CloseTime = 5, Text = filePath }.Show(MainPage.BasePageView);
-                    });
-#endif
-                    fs = new FileStream(filePath, FileMode.Create, FileAccess.Write);
-                    fs.Write(headImageBytes, 0, headImageBytes.Length);
-                    fs.Flush();
-                    MainPage.LoginUser.headImagePagePath = filePath;
+                        var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(headImageString);
+                        var headImageBytes = Newtonsoft.Json.JsonConvert.DeserializeObject<byte[]>(jsonString);
+                        MainPage.LoginUser.headImagePageBytes = headImageBytes;
+                        var filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/", "headImage.png");
+                        fs = new FileStream(filePath, FileMode.Create, FileAccess.Write);
+                        fs.Write(headImageBytes, 0, headImageBytes.Length);
+                        fs.Flush();
+                        MainPage.LoginUser.headImagePagePath = filePath;
+                    }
                 } catch (Exception ex)
                 {
                     MainPage.Log($"download headImage error : {ex.Message}");
@@ -319,6 +338,18 @@
 
             var revertObj = RequestHttps($"{severAddress}/ZigbeeUsers/UpdateHeadImage", requestJson, true);
             return revertObj.StateCode;
+        }
+
+        /// <summary>
+        /// 鏇存敼缁戝畾璐︽埛鐨勯偖绠辨垨鑰呮墜鏈哄彿
+        /// </summary>
+        /// <param name="account"></param>
+        /// <returns></returns>
+        public string BindAccount(string account)
+        {
+            string jsonString = "{" + "\"Account\":" + "\"" + account + "\"" + "}";
+            var responsePack = RequestHttps($"{severAddress}/ZigbeeUsers/BindAccount", jsonString, true);
+            return responsePack.StateCode;
         }
         #endregion
 
@@ -382,7 +413,12 @@
                             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;
+                        }
                         MainPage.LoginUser.regionList.Add(home);
                         if (string.IsNullOrEmpty(DB_ResidenceData.residenceData.CurReginID))
                         {
@@ -530,6 +566,32 @@
         }
 
         /// <summary>
+        /// 鍒犻櫎鍏变韩鏁版嵁
+        /// </summary>
+        /// <param name="shareData"></param>
+        /// <returns></returns>
+        public ResponsePack DeleteShareData(ShareData shareData)
+        {
+            Dictionary<string, string> d = new Dictionary<string, string>();
+            d.Add("DistributedMark", shareData.DistributedMark);
+            d.Add("HouseDistributedMark", shareData.HouseDistributedMark);
+            string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
+            return RequestHttps($"{severAddress}/ZigbeeDataShare/DeleteShareData", jsonString, true);
+        }
+        /// <summary>
+        /// 鍒犻櫎瀛愯处鍙峰綋鍓嶄綇瀹呯殑鎵�鏈夊叡浜暟鎹�
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePack DeleteCurrentResidenceSharedData(ShareData shareData)
+        {
+            Dictionary<string, string> d = new Dictionary<string, string>();
+            d.Add("SubAccountDistributedMark", shareData.SubAccountDistributedMark);
+            d.Add("HouseDistributedMark", shareData.HouseDistributedMark);
+            string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
+            return RequestHttps($"{severAddress}/ZigbeeDataShare/DeleteShareData", jsonString, true);
+        }
+
+        /// <summary>
         /// 缁戝畾瀛愯处鍙峰埌浣忓畢涓�
         /// </summary>
         /// <param name="subAccount"></param>
@@ -627,6 +689,52 @@
 
         #endregion
 
+        #region mqtt杩滅▼杩炴帴锛堟棫锛�
+        /// <summary>
+        /// 璇锋眰Mqtt鏁版嵁
+        /// </summary>
+        /// <param name="dataStringJson">璇锋眰鐨勫弬鏁�.</param>
+        public ResponsePack RequestMqttInfo( string dataStringJson)
+        {
+            ResponsePack revertObj = null;
+
+            var webClient = new WebClient();
+            #region
+            webClient.Headers.Add("CONTENT-TYPE", "application/json");
+            var url = "https://global.hdlcontrol.com/ProposedProductionApi/EmqMqtt/GetConnMqttInfo";
+
+            byte[] bytes = null;
+            try
+            {
+                bytes = webClient.UploadData(url, Encoding.UTF8.GetBytes(dataStringJson));
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+                revertObj = new ResponsePack() { StateCode = "Net_Error" };
+            }
+
+            string responseString = null;
+            if (bytes != null)
+            {
+                responseString = Encoding.UTF8.GetString(bytes);
+            }
+
+            if (responseString != null)
+            {
+                try
+                {
+                    revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(responseString);
+                }
+                catch (Exception ex)
+                {
+                    Console.WriteLine(ex.ToString());
+                }
+            }
+            return revertObj;
+            #endregion
+        }
+        #endregion
 
         #region 澶囦唤閮ㄥ垎
         /// <summary>
@@ -655,7 +763,7 @@
             }
             return backupList;
         }
-
+        /* 2020-09-01 寮冪敤 鎭㈠鏃ф暟鎹姛鑳藉湪bus杞欢涓婂疄鐜�
         /// <summary>
         /// 鑾峰彇澶囦唤鏂囦欢鍒楄〃
         /// </summary>
@@ -786,7 +894,7 @@
                 //    backgroundImage = "Classification/Room/Roombg.png",
                 //    //backgroundImage = ss.GetValue("BackGroundImage").ToString() == "Room/r1.png" ? "Classification/Room/Roombg.png" : filePath,
                 //};
-                //DB_ResidenceData.residenceData.rooms.Add(room1);
+                //DB_ResidenceData.rooms.Add(room1);
                 //roomList.Add(ss, room1);
 
             }
@@ -859,23 +967,8 @@
 
                 /// <summary>
                 /// 鍔熻兘ID
-                /// 鍘傚晢浠g爜	2bytes;     01	HDL
-                /// 閫氳鏂瑰紡	1byte ;     01	HDL Bus; 02	Zigbee;03	KNX;04	Z-Wave
-                /// 浜у搧GUID	8bytes
-                /// 浜у搧绫诲埆	1byte ;     01  璋冨厜鍣�;02缁х數鍣�;03骞叉帴鐐规ā鍧�;04浼犳劅鍣�;05闈㈡澘
-                /// 鐗╂ā鍨嬬被鍨�2bytes      01 寮�鍏崇被    --01寮�鍏�;02鎻掑骇
-                ///		                02	鐓ф槑     --01寮�鍏崇被;02璋冨厜绫�;03鑹叉俯;04LED
-                ///		                03	閬槼     --01绐楀笜鐢垫満;02鐧惧彾绐�;03寮�鍚堝笜;04鍗峰笜
-                ///		                04	鎭掓俯鍣�    --01绌鸿皟;02鍦版殩;03姣涚粏绌鸿皟
-                ///             		05	鏂伴		
-                ///             		06	褰遍煶		
-                ///             		07	闊充箰		
-                ///		                08	鑳芥簮		
-                ///		                09	瀹夐槻
-                /// 閫氶亾鍙�	2bytes
-                /// Key_id  2bytes
                 /// </summary>
-                /// "00010112345678901234560101230123AABB";
+                /// "03010112345678901234560101230123AABB";
                 var buffer = Guid.NewGuid().ToByteArray();
                 string guid = "";
                 if (buffer != null)
@@ -904,19 +997,19 @@
                 {
                     case "LightSwitch":
                     case "LightMixSwitch":
-                        var light1 = DB_ResidenceData.residenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
+                        var light1 = DB_ResidenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
                           obj.bus_Data.DeviceID == (byte)ss.GetValue("DeviceID") && obj.bus_Data.LoopID == (byte)ss.GetValue("LoopID"));
                         if (light1 != null)
                         {
                             //light1.roomIdList.Add(roomSid);
                             break;
                         }
-                        DB_ResidenceData.residenceData.functionList.lights.Add(new Light()
+                        DB_ResidenceData.functionList.lights.Add(new Light()
                         {
-                            sid = "000101" + guid + "0102010001AABB",
+                            sid = "030101" + guid + "0102010001AABB",
                             name = ss.GetValue("Name").ToString(),
                             function = new List<Trait>() {
-                                    new Trait { attri="on_off", max=100,min = 0, value= new List<string> { "on","off"} },
+                                    new Trait { name="on_off", max=100,min = 0, value_key= new List<string> { "on","off"} },
                                 },
                             roomIdList = roomIds,
                             bus_Data = new BusData
@@ -930,19 +1023,19 @@
                     case "LightDimming":
                     case "LightDALI":
                     case "LightMixDimming":
-                        var light2 = DB_ResidenceData.residenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
+                        var light2 = DB_ResidenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
                           obj.bus_Data.DeviceID == (byte)ss.GetValue("DeviceID") && obj.bus_Data.LoopID == (byte)ss.GetValue("LoopID"));
                         if (light2 != null)
                         {
                             //light2.roomIdList.Add(roomSid);
                             break;
                         }
-                        DB_ResidenceData.residenceData.functionList.lights.Add(new Light()
+                        DB_ResidenceData.functionList.lights.Add(new Light()
                         {
-                            sid = "000101" + guid + "0202020001AABB",
+                            sid = "030101" + guid + "0202020001AABB",
                             name = ss.GetValue("Name").ToString(),
                             function = new List<Trait>() {
-                                        new Trait { attri="brightness", max=100,min = 0, value= new List<string> { "up","down"} },
+                                        new Trait { name="brightness", max=100,min = 0, value_key= new List<string> { "up","down"} },
                                     },
                             roomIdList = roomIds,
                             //roomIdList = new List<string>() { "0001" },
@@ -957,20 +1050,20 @@
                         break;
                     case "LightLogic":
                     case "LightRGB":
-                        var light3 = DB_ResidenceData.residenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
+                        var light3 = DB_ResidenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
                           obj.bus_Data.DeviceID == (byte)ss.GetValue("DeviceID") && obj.bus_Data.LoopID == (byte)ss.GetValue("LoopID"));
                         if (light3 != null)
                         {
                             //light3.roomIdList.Add(roomSid);
                             break;
                         }
-                        DB_ResidenceData.residenceData.functionList.lights.Add(new Light()
+                        DB_ResidenceData.functionList.lights.Add(new Light()
                         {
-                            sid = "000101" + guid + "0202040001AABB",
+                            sid = "030101" + guid + "0202040001AABB",
                             name = ss.GetValue("Name").ToString(),
                             function = new List<Trait>() {
-                                        new Trait { attri="brightness", max=100,min = 0, value= new List<string> { "on","off"} },
-                                        new Trait { attri="color", max=100,min = 0, value= new List<string> { "255", "255", "255" } },
+                                        new Trait { name="brightness", max=100,min = 0, value_key= new List<string> { "on","off"} },
+                                        new Trait { name="color", max=100,min = 0, value_key= new List<string> { "255", "255", "255" } },
                                     },
                             roomIdList = roomIds,
                             //roomIdList = new List<string>() { roomSid },
@@ -986,22 +1079,22 @@
                     case "HVAC":
                     case "ACPanel":
                     case "ACInfrared":
-                        var ac = DB_ResidenceData.residenceData.functionList.aCs.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
+                        var ac = DB_ResidenceData.functionList.aCs.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
                           obj.bus_Data.DeviceID == (byte)ss.GetValue("DeviceID") && obj.bus_Data.LoopID == (byte)ss.GetValue("LoopID"));
                         if (ac != null)
                         {
                             //ac.roomIdList.Add(roomSid);
                             break;
                         }
-                        DB_ResidenceData.residenceData.functionList.aCs.Add(new AC()
+                        DB_ResidenceData.functionList.aCs.Add(new AC()
                         {
-                            sid = "000101" + guid + "0204010001AABB",
+                            sid = "030101" + guid + "0204010001AABB",
                             name = ss.GetValue("Name").ToString(),
                             function = new List<Trait>() {
-                                        new Trait { attri="on_off", max=1,min = 0, value= new List<string> { "on","off"} },
-                                        new Trait { attri="mode", max = 2,min =0,value = new List<string>{ "auto", "heat", "cool","dry" } },
-                                        new Trait { attri = "fan",max = 3,min =0,value = new List<string>{ "low", "mid", "high" ,"auto"} },
-                                        new Trait { attri = "temperature", max = 32,min=16,value = new List<string>{"up","down" } },
+                                        new Trait { name="on_off", max=1,min = 0, value_key= new List<string> { "on","off"} },
+                                        new Trait { name="mode", max = 2,min =0,value_key = new List<string>{ "auto", "heat", "cool","dry" } },
+                                        new Trait { name = "fan",max = 3,min =0,value_key = new List<string>{ "low", "mid", "high" ,"auto"} },
+                                        new Trait { name = "temperature", max = 32,min=16,value_key = new List<string>{"up","down" } },
                                     },
                             roomIdList = roomIds,
                             //roomIdList = new List<string>() { roomSid},
@@ -1016,21 +1109,21 @@
                         break;
                     //Entity.
                     case "CurtainModel":
-                        var curtain1 = DB_ResidenceData.residenceData.functionList.curtains.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
+                        var curtain1 = DB_ResidenceData.functionList.curtains.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
                           obj.bus_Data.DeviceID == (byte)ss.GetValue("DeviceID") && obj.bus_Data.LoopID == (byte)ss.GetValue("LoopID"));
                         if (curtain1 != null)
                         {
                             //curtain1.roomIdList.Add(roomSid);
                             break;
                         }
-                        DB_ResidenceData.residenceData.functionList.curtains.Add(new Curtain()
+                        DB_ResidenceData.functionList.curtains.Add(new Curtain()
                         {
-                            sid = "000101" + guid + "0203010001AABB",
+                            sid = "030101" + guid + "0203010001AABB",
                             name = ss.GetValue("Name").ToString(),
                             roomIdList = roomIds,
                             //roomIdList = new List<string>() { roomSid },
                             function = new List<Trait>() {
-                                        new Trait { attri="on_off", max=2,min = 0, value= new List<string> { "on","off","stop"} },
+                                        new Trait { name="on_off", max=2,min = 0, value_key= new List<string> { "on","off","stop"} },
                                     },// "curtain",
                             lastState = "寮�",
                             bus_Data = new BusData
@@ -1042,21 +1135,21 @@
                         });
                         break;
                     case "CurtainRoller":
-                        var curtain2 = DB_ResidenceData.residenceData.functionList.curtains.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
+                        var curtain2 = DB_ResidenceData.functionList.curtains.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
                          obj.bus_Data.DeviceID == (byte)ss.GetValue("DeviceID") && obj.bus_Data.LoopID == (byte)ss.GetValue("LoopID"));
                         if (curtain2 != null)
                         {
                             //curtain2.roomIdList.Add(roomSid);
                             break;
                         }
-                        DB_ResidenceData.residenceData.functionList.curtains.Add(new Curtain()
+                        DB_ResidenceData.functionList.curtains.Add(new Curtain()
                         {
-                            sid = "000101" + guid + "0203040001AABB",
+                            sid = "030101" + guid + "0203040001AABB",
                             name = ss.GetValue("Name").ToString(),
                             roomIdList = roomIds,
                             //roomIdList = new List<string>() { roomSid },
                             function = new List<Trait>() {
-                                        new Trait { attri="on_off", max=100,min = 0, value= new List<string> { "on","off","stop"} },
+                                        new Trait { name="on_off", max=100,min = 0, value_key= new List<string> { "on","off","stop"} },
                                     },// "rollingshutter",
                             lastState = "20%",
                             bus_Data = new BusData
@@ -1068,21 +1161,21 @@
                         });
                         break;
                     case "CurtainTrietex":
-                        var curtain3 = DB_ResidenceData.residenceData.functionList.curtains.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
+                        var curtain3 = DB_ResidenceData.functionList.curtains.Find((obj) => obj.bus_Data.SubnetID == (byte)ss.GetValue("SubnetID") &&
                          obj.bus_Data.DeviceID == (byte)ss.GetValue("DeviceID") && obj.bus_Data.LoopID == (byte)ss.GetValue("LoopID"));
                         if (curtain3 != null)
                         {
                             //curtain3.roomIdList.Add(roomSid);
                             break;
                         }
-                        DB_ResidenceData.residenceData.functionList.curtains.Add(new Curtain()
+                        DB_ResidenceData.functionList.curtains.Add(new Curtain()
                         {
-                            sid = "000101" + guid + "0203030001AABB",
+                            sid = "030101" + guid + "0203030001AABB",
                             name = ss.GetValue("Name").ToString(),
                             roomIdList = roomIds,
                             //roomIdList = new List<string>() { roomSid },
                             function = new List<Trait>() {
-                                        new Trait { attri="on_off", max=100,min = 0, value= new List<string> { "on","off","stop"} },
+                                        new Trait { name="on_off", max=100,min = 0, value_key= new List<string> { "on","off","stop"} },
                                     },
                             lastState = "20%",
                             bus_Data = new BusData
@@ -1093,7 +1186,7 @@
                             },
                         });
                         break;
-                        //Entity.DB_ResidenceData.residenceData.functionList.floorHeatings.Add(new FloorHeating()
+                        //Entity.DB_ResidenceData.functionList.floorHeatings.Add(new FloorHeating()
                         //{
                         //    sid = "12341212345678901234560704010004ABCD",
                         //    name = "鍦扮儹",
@@ -1111,7 +1204,7 @@
 
             }
         }
-
+        */
 
         #endregion
     }

--
Gitblit v1.8.0