using InnovEnergy.Lib.Utils; using InnovEnergy.Lib.Victron.VeDBus; using InnovEnergy.WireFormat.VictronV1; namespace InnovEnergy.VenusLogger.Parsers; public static class Grid { public static Maybe GetGrid(this IEnumerable services) { return services .Where(VeService.IsGridService) .Select(GetGridDevice) .SingleOrDefault() .Maybe(); } private static Device GetGridDevice(this ServiceProperties serviceProps) { return new Device { Type = DeviceType.Grid, Phases = { serviceProps.Properties.GetAcPhases() } }; } }