diff --git a/src/main/java/eu/m724/wtapi/provider/Providers.java b/src/main/java/eu/m724/wtapi/provider/Providers.java index 4e98afc..efc1823 100644 --- a/src/main/java/eu/m724/wtapi/provider/Providers.java +++ b/src/main/java/eu/m724/wtapi/provider/Providers.java @@ -3,6 +3,8 @@ package eu.m724.wtapi.provider; import eu.m724.wtapi.provider.exception.NoSuchProviderException; import eu.m724.wtapi.provider.thunder.ThunderProvider; import eu.m724.wtapi.provider.thunder.impl.blitzortung.BlitzortungProvider; +import eu.m724.wtapi.provider.twilight.ApproximateTwilightTimeProvider; +import eu.m724.wtapi.provider.twilight.TwilightTimeProvider; import eu.m724.wtapi.provider.weather.WeatherProvider; import eu.m724.wtapi.provider.weather.impl.openweathermap.OpenWeatherMapProvider; @@ -10,8 +12,8 @@ public class Providers { public static ThunderProvider getThunderProvider(String name, String apiKey) throws NoSuchProviderException { switch (name.toLowerCase()) { - case "blitzortung": - return new BlitzortungProvider(); + case "blitzortung": + return new BlitzortungProvider(); } throw new NoSuchProviderException(); @@ -19,11 +21,20 @@ public class Providers { public static WeatherProvider getWeatherProvider(String name, String apiKey) throws NoSuchProviderException { switch (name.toLowerCase()) { - case "openweathermap": - return new OpenWeatherMapProvider(apiKey); + case "openweathermap": + return new OpenWeatherMapProvider(apiKey); } throw new NoSuchProviderException(); } + + public static TwilightTimeProvider getTwilightTimeProvider(String name, String apiKey) throws NoSuchProviderException { + switch (name.toLowerCase()) { + case "approximate": + return new ApproximateTwilightTimeProvider(); + } + + throw new NoSuchProviderException(); + } }