using System.Text.Json; using System.Text.Json.Nodes; using Flurl.Http; namespace InnovEnergy.Lib.Victron.VictronVRM; public readonly partial record struct Installation { public async Task> GetAlarms() { var reply = await VrmAccount.AlarmsRequest(IdSite).TryGetJson(); // Console.WriteLine("Got"); var vrmReply = new Reply(reply); Console.WriteLine(vrmReply.ToString()); if (!vrmReply.Success) throw new Exception(nameof(GetAlarms) + " failed"); Console.WriteLine(vrmReply.Alarms); return vrmReply.Alarms; } public async Task SetAlarms(JsonObject tags) { var reply = await VrmAccount.AlarmsRequest(IdSite).TryPutJson(tags); var vrmReply = new Reply(reply); // Console.WriteLine(vrmReply.Success.ToString()); if (!vrmReply.Success) throw new Exception(nameof(SetAlarms) + " failed"); return vrmReply.Success; } }