Skip to content

Commit

Permalink
[openweathermap] Fixed UV-Index Channel Group Creation (openhab#9832)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: John Marshall <john.marshall.au@gmail.com>
  • Loading branch information
cweitkamp authored and themillhousegroup committed May 10, 2021
1 parent 2f3a7b6 commit 79fae3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@ public void initialize() {
}
} 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;
Expand Down

0 comments on commit 79fae3a

Please sign in to comment.