| | |
| | | using System; |
| | | using Newtonsoft.Json.Linq; |
| | | |
| | | namespace HDL_ON.Entity |
| | | { |
| | | public class Curtain : Function |
| | |
| | | return type; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 拼接、获取A协议操作数据 |
| | | /// </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; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |