using System; using Newtonsoft.Json.Linq; namespace HDL_ON.Entity { public class Dimmer : Light { public Dimmer() { bus_DeviceType = "Dimmer"; } /// /// 亮度 /// public int brightness = 100; /// /// 拼接、获取A协议操作数据 /// public override JObject GetSendJObject(string command) { var openBrightness = state == 0 ? 0 : brightness; var sendJob = new JObject { { "Namespace", a_Protocol_Namespace }, { "Command", command }, { "Type", "device" } }; var data = new JObject { { "Switch", state }, { "Dimmer", openBrightness }, { "sid", sid } }; sendJob.Add("objects", data); return sendJob; } } }