using System;
|
using System.Collections.Generic;
|
using Newtonsoft.Json.Linq;
|
|
namespace HDL_ON.Entity
|
{
|
public class Light : Function
|
{
|
public Light()
|
{
|
bus_DeviceType = "Relay";
|
}
|
|
/// <summary>
|
/// 开关状态
|
/// 0:关
|
/// 1:开
|
/// </summary>
|
public int state = 0;
|
|
public List<string> PropertyArray = new List<string>();
|
|
/// <summary>
|
/// 拼接、获取A协议操作数据
|
/// </summary>
|
public override JObject GetSendJObject(string command )
|
{
|
var sendJob = new JObject();
|
if (command == "write")
|
{
|
|
sendJob = new JObject { { "Namespace", a_Protocol_Namespace }, { "Command", command }, { "Type", "device" } };
|
var data = new JObject { { "Switch", state }, { "sid", sid } };
|
sendJob.Add("objects", data);
|
return sendJob;
|
}
|
else if(command == "read")
|
{
|
|
}
|
return sendJob;
|
}
|
}
|
}
|