From 8da70e1a39328e1769b02bb1e05303916bb30eb5 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期一, 01 二月 2021 13:55:31 +0800 Subject: [PATCH] 水阀功能 --- HDL_ON/Entity/FunctionList.cs | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs old mode 100755 new mode 100644 index a6b3d33..7e43be8 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -75,12 +75,17 @@ { weepRobots = new List<WeepRobot>(); } + if(waterValveList == null) + { + waterValveList = new List<Function>(); + } var list = new List<Function>(); list.AddRange(fans); list.AddRange(switchSockets); list.AddRange(tVs); list.AddRange(airCleaners); list.AddRange(weepRobots); + list.AddRange(waterValveList); return list; } } @@ -104,6 +109,10 @@ /// 鎵湴鏈哄櫒浜哄垪琛� /// </summary> public List<WeepRobot> weepRobots = new List<WeepRobot>(); + /// <summary> + /// 姘撮榾鍒楄〃 + /// </summary> + public List<Function> waterValveList = new List<Function>(); #endregion /// <summary> @@ -140,6 +149,7 @@ /// <param name="filePath"></param> public void IniFunctionList(string filePath) { + // todo 澧炲姞璁惧锛屽鍔犲姛鑳借繘鍔熻兘鍒楄〃 if (filePath.StartsWith("FunctionData_")) { var functionDataBytes = Common.FileUtlis.Files.ReadFile(filePath); @@ -224,6 +234,11 @@ List.weepRobots.Add(tuyaWeepRobot); deviceFunctionList.Add(tuyaWeepRobot); break; + case SPK.ElectricTuyaWaterValve: + var tuyaWaterValve = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(functionDataString); + List.waterValveList.Add(tuyaWaterValve); + deviceFunctionList.Add(tuyaWaterValve); + break; case SPK.SensorSmoke: case SPK.SensorWater: case SPK.SensorGas: -- Gitblit v1.8.0