From 6ddf5ec9fd46b2468027cc0cbc55b9060006a654 Mon Sep 17 00:00:00 2001
From: Christoph Weitkamp <github@christophweitkamp.de>
Date: Sun, 24 Jan 2021 15:47:15 +0100
Subject: [PATCH] [openweathermap] Fixed UV-Index Channel Group Creation
 (#9832)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
---
 .../internal/OpenWeatherMapBindingConstants.java         | 3 ++-
 .../internal/handler/OpenWeatherMapUVIndexHandler.java   | 9 +++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/OpenWeatherMapBindingConstants.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/OpenWeatherMapBindingConstants.java
index 260faa869..ea3c6afad 100644
--- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/OpenWeatherMapBindingConstants.java
+++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/OpenWeatherMapBindingConstants.java
@@ -52,7 +52,8 @@ public class OpenWeatherMapBindingConstants {
             "hourlyForecast");
     public static final ChannelGroupTypeUID CHANNEL_GROUP_TYPE_DAILY_FORECAST = new ChannelGroupTypeUID(BINDING_ID,
             "dailyForecast");
-    public static final ChannelGroupTypeUID CHANNEL_GROUP_TYPE_UVINDEX = new ChannelGroupTypeUID(BINDING_ID, "uvindex");
+    public static final ChannelGroupTypeUID CHANNEL_GROUP_TYPE_UVINDEX_FORECAST = new ChannelGroupTypeUID(BINDING_ID,
+            "uvindexForecast");
     public static final ChannelGroupTypeUID CHANNEL_GROUP_TYPE_ONECALL_MINUTELY_FORECAST = new ChannelGroupTypeUID(
             BINDING_ID, "oneCallMinutely");
     public static final ChannelGroupTypeUID CHANNEL_GROUP_TYPE_ONECALL_HOURLY_FORECAST = new ChannelGroupTypeUID(
diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapUVIndexHandler.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapUVIndexHandler.java
index e50ff82b1..141a5896d 100644
--- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapUVIndexHandler.java
+++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapUVIndexHandler.java
@@ -95,12 +95,13 @@ public class OpenWeatherMapUVIndexHandler extends AbstractOpenWeatherMapHandler
                     }
                 } else {
                     if (forecastDays <= 1 && newForecastDays > 1) {
-                        toBeAddedChannels.addAll(
-                                createChannelsForGroup(CHANNEL_GROUP_FORECAST_TOMORROW, CHANNEL_GROUP_TYPE_UVINDEX));
+                        toBeAddedChannels.addAll(createChannelsForGroup(CHANNEL_GROUP_FORECAST_TOMORROW,
+                                CHANNEL_GROUP_TYPE_UVINDEX_FORECAST));
                     }
                     for (int i = (forecastDays < 2) ? 2 : forecastDays; i < newForecastDays; ++i) {
-                        toBeAddedChannels.addAll(createChannelsForGroup(
-                                CHANNEL_GROUP_FORECAST_PREFIX + Integer.toString(i), CHANNEL_GROUP_TYPE_UVINDEX));
+                        toBeAddedChannels
+                                .addAll(createChannelsForGroup(CHANNEL_GROUP_FORECAST_PREFIX + Integer.toString(i),
+                                        CHANNEL_GROUP_TYPE_UVINDEX_FORECAST));
                     }
                 }
                 forecastDays = newForecastDays;