From a8d714624601beece61dcadd780e04ecf3cdcd84 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sun, 18 Feb 2024 00:12:21 +0100 Subject: [PATCH] [openweathermap] Finish clean-up & Fix OneCall Forecast Thing channel creation (#16416) * [openweathermap] Clean-Up config.xml Remove config description for removed UV Index Thing. * [openweathermap] Fix OneCall Thing creates to many channels The default setting is to create 0 minutes, 12 hours and 6 days of forecast channels. When creating a new OneCall Thing, actually 60 minutes, 24 hours and 8 days of forecast were created due to the thing-types, but those not needed (as determined by the configuration) were not removed. Signed-off-by: Florian Hotze Signed-off-by: Ciprian Pascu --- .../handler/OpenWeatherMapOneCallHandler.java | 6 +++--- .../src/main/resources/OH-INF/config/config.xml | 13 ------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapOneCallHandler.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapOneCallHandler.java index 80bf8c5dd8c..6c21c4e3720 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapOneCallHandler.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapOneCallHandler.java @@ -85,9 +85,9 @@ public class OpenWeatherMapOneCallHandler extends AbstractOpenWeatherMapHandler private @Nullable OpenWeatherMapOneCallAPIData weatherData; // forecastMinutes, -Hours and -Days determine the number of channel groups to create for each type - private int forecastMinutes = 0; - private int forecastHours = 12; - private int forecastDays = 6; + private int forecastMinutes = 60; + private int forecastHours = 48; + private int forecastDays = 8; private int numberOfAlerts = 0; public OpenWeatherMapOneCallHandler(Thing thing, final TimeZoneProvider timeZoneProvider) { diff --git a/bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/config/config.xml b/bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/config/config.xml index 58c40dc36e1..871d66ef76b 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/config/config.xml +++ b/bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/config/config.xml @@ -97,19 +97,6 @@ - - - location - - Location of weather in geographical coordinates (latitude/longitude/altitude). - - - - Number of days for UV Index forecast. - 6 - - - location