Skip to content

Commit

Permalink
[openweathermap] Finish clean-up & Fix OneCall Forecast Thing channel…
Browse files Browse the repository at this point in the history
… creation (openhab#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 <florianh_dev@icloud.com>
  • Loading branch information
florian-h05 committed Feb 17, 2024
1 parent 5c4b8f2 commit 6480179
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,6 @@
</parameter>
</config-description>

<config-description uri="thing-type:openweathermap:uvindex">
<parameter name="location" type="text" required="true">
<context>location</context>
<label>Location of Weather</label>
<description>Location of weather in geographical coordinates (latitude/longitude/altitude).</description>
</parameter>
<parameter name="forecastDays" type="integer" min="1" max="8" step="1">
<label>Number of Days</label>
<description>Number of days for UV Index forecast.</description>
<default>6</default>
</parameter>
</config-description>

<config-description uri="thing-type:openweathermap:air-pollution">
<parameter name="location" type="text" required="true">
<context>location</context>
Expand Down

0 comments on commit 6480179

Please sign in to comment.