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