19 lines
450 B
C#
19 lines
450 B
C#
using System.Text.Json.Nodes;
|
|
|
|
namespace InnovEnergy.Lib.StatusApi;
|
|
|
|
public class Device : IDevice
|
|
{
|
|
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!);
|
|
}
|
|
} |