Innovenergy_trunk/csharp/lib/StatusApi/Phase.cs

20 lines
430 B
C#
Raw Normal View History

2023-02-16 12:57:06 +00:00
using System.Text.Json.Nodes;
namespace InnovEnergy.Lib.StatusApi;
public record Phase : IPhase
{
public Double Voltage { get; init; }
public Double Current { get; init; }
public JsonNode ToJson()
{
var jsonDict = new Dictionary<String, JsonNode>
{
[nameof(Voltage)] = Voltage,
[nameof(Current)] = Current
};
return new JsonObject(jsonDict!);
}
}