20 lines
430 B
C#
20 lines
430 B
C#
|
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!);
|
||
|
}
|
||
|
}
|