[openweathermap] Fixed UV-Index Channel Group Creation (#9832)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
Christoph Weitkamp 2021-01-24 15:47:15 +01:00 committed by GitHub
parent b0a15b48a3
commit 6ddf5ec9fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -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(

View File

@ -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;