From b69d7735274b8d0f741da8a6bb8b8e1347477a5a Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 19 三月 2020 17:14:16 +0800 Subject: [PATCH] 20200319 --- HDL_ON/Entity/Function/Curtain/Curtain.cs | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/HDL_ON/Entity/Function/Curtain/Curtain.cs b/HDL_ON/Entity/Function/Curtain/Curtain.cs index 7174afa..c0adeff 100644 --- a/HDL_ON/Entity/Function/Curtain/Curtain.cs +++ b/HDL_ON/Entity/Function/Curtain/Curtain.cs @@ -1,4 +1,6 @@ 锘縰sing System; +using Newtonsoft.Json.Linq; + namespace HDL_ON.Entity { public class Curtain : Function @@ -38,5 +40,39 @@ return type; } + + /// <summary> + /// 鎷兼帴銆佽幏鍙朅鍗忚鎿嶄綔鏁版嵁 + /// </summary> + public override JObject GetSendJObject(string command) + { + var sendJob = new JObject(); + if (command == "write") + { + + sendJob = new JObject { { "vendor_code", a_Protocol_Namespace }, { "Command", command }, { "Type", "device" } }; + JObject data = null; + switch (functionType) + { + case "Curtain"://绐楀笜妯″潡鎺у埗 + data = new JObject { { "switch", state }, { "sid", sid } }; + break; + case "MotorCurtain": + case "RollingShutter": + data = new JObject { { "openLevel", dicPropert["openLevel"] }, { "sid", sid } }; + break; + } + sendJob.Add("objects", data); + } + else if (command == "read") + { + sendJob = new JObject { { "vendor_code", a_Protocol_Namespace }, { "Command", command }, { "Type", "device" } }; + var data = new JObject { { "sid", sid } }; + sendJob.Add("objects", data); + } + return sendJob; + } + + } } -- Gitblit v1.8.0