Innovenergy_trunk/csharp/Lib/Victron/VictronVRM/Device.cs

12 lines
507 B
C#
Raw Normal View History

2023-02-16 12:57:06 +00:00
using System.Text.Json.Nodes;
using InnovEnergy.Lib.Utils;
namespace InnovEnergy.Lib.Victron.VictronVRM;
public readonly record struct Device(JsonNode Json)
{
public String Type => Json.TryGetString("name")?.Trim() ?? "";
public String ProductName => Json.TryGetString("productName")?.Trim() ?? "";
public String FirmwareVersion => Json.TryGetString("firmwareVersion")?.Trim() ?? "";
public String SerialNumber => Json.TryGetString("machineSerialNumber")?.Trim() ?? "";
}