Innovenergy_trunk/csharp/lib/StatusApi/Dc48Device.cs

20 lines
499 B
C#

using System.Text.Json.Nodes;
namespace InnovEnergy.Lib.StatusApi;
public record Dc48Device : IDc48Device
{
public IPhase? Dc48 { get; init; }
public DeviceType Type { get; init; }
public String? Name { get; init; }
public JsonNode ToJson()
{
var jsonDict = new Dictionary<String, JsonNode>();
jsonDict[nameof(Type)] = Type.ToString()!;
jsonDict[nameof(Name)] = Name;
return new JsonObject(jsonDict!);
}
}