]> git.basschouten.com Git - openhab-addons.git/commitdiff
[openweathermap] Finish clean-up & Fix OneCall Forecast Thing channel creation (...
authorFlorian Hotze <florianh_dev@icloud.com>
Sat, 17 Feb 2024 23:12:21 +0000 (00:12 +0100)
committerGitHub <noreply@github.com>
Sat, 17 Feb 2024 23:12:21 +0000 (00:12 +0100)
* [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>
bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapOneCallHandler.java
bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/config/config.xml

index 80bf8c5dd8c50e360d5104df24b2b5da47ef8e6d..6c21c4e37207b5cea8483fea901f69b28f0ff510 100644 (file)
@@ -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) {
index 58c40dc36e1caf9f21fdc6a36bf3e744d98184b3..871d66ef76b73dcf7b14f971c68bb025370b6741 100644 (file)
                </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>