]> git.basschouten.com Git - openhab-addons.git/commitdiff
Configurable refreshinterval (#17523)
authorlsiepel <leosiepel@gmail.com>
Fri, 11 Oct 2024 11:12:43 +0000 (13:12 +0200)
committerGitHub <noreply@github.com>
Fri, 11 Oct 2024 11:12:43 +0000 (13:12 +0200)
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
bundles/org.openhab.binding.omnikinverter/README.md
bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterConfiguration.java
bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/handler/OmnikInverterHandler.java
bundles/org.openhab.binding.omnikinverter/src/main/resources/OH-INF/i18n/omnikinverter.properties
bundles/org.openhab.binding.omnikinverter/src/main/resources/OH-INF/thing/thing-types.xml

index 54b649b089790c0d8b55844c1139bea412fae80d..0d06b761570e2ad94141ba6288d884a900f337b4 100644 (file)
@@ -13,11 +13,12 @@ No autodiscovery available
 
 ## Thing Configuration
 
-| Config   | Description                                                                                                                    | type    | Default   |
-| :------- | :------------                                                                                                                  | :-----  | :-------- |
-| hostname | The hostname or ip through which the inverter can be accessed                                                                  | string  | n/a       |
-| port     | TCP port through which the inverter listens on for incoming connections                                                        | integer | 8899      |
-| serial   | The serial of the wifi module. The Wifi module's SSID contains the number. This is the numerical part only, i.e. without _AP__ | integer | n/a       |
+| Config          | Description                                                                                                                    | type    | Default |
+|:----------------|:-------------------------------------------------------------------------------------------------------------------------------|:--------|:--------|
+| hostname        | The hostname or ip through which the inverter can be accessed                                                                  | string  | n/a     |
+| port            | TCP port through which the inverter listens on for incoming connections                                                        | integer | 8899    |
+| serial          | The serial of the wifi module. The Wifi module's SSID contains the number. This is the numerical part only, i.e. without _AP__ | integer | n/a     |
+| refreshInterval | Interval the device is polled in seconds.                                                                                      | integer | 10      |
 
 ## Channels
 
index fdf95cf952e391c87c9f193a4f36e679a434e2d5..da2b01c9d9c26b24a48f279fca2a1f83d92180ae 100644 (file)
@@ -74,7 +74,7 @@ public class OmnikInverterHandler extends BaseThingHandler {
 
         inverter = new OmnikInverter(config.hostname, config.port, config.serial);
         updateStatus(ThingStatus.UNKNOWN);
-        pollJob = scheduler.scheduleWithFixedDelay(this::updateData, 0, 10, TimeUnit.SECONDS);
+        pollJob = scheduler.scheduleWithFixedDelay(this::updateData, 0, config.refreshInterval, TimeUnit.SECONDS);
     }
 
     @Override
index 0ab0fc4b5c597a34a0fe2d917bb061594de782d0..fb639c1281e621446d6ccd42ee60dec44094d6f7 100644 (file)
@@ -50,6 +50,8 @@ thing-type.config.omnikinverter.omnik.hostname.label = Hostname
 thing-type.config.omnikinverter.omnik.hostname.description = The hostname or IP of the Omnik Inverter
 thing-type.config.omnikinverter.omnik.port.label = Port
 thing-type.config.omnikinverter.omnik.port.description = The TCP port of the Omnik inverter, usually 8899
+thing-type.config.omnikinverter.omnik.refreshInterval.label = Refresh Interval
+thing-type.config.omnikinverter.omnik.refreshInterval.description = Interval the device is polled in seconds.
 thing-type.config.omnikinverter.omnik.serial.label = Serial
 thing-type.config.omnikinverter.omnik.serial.description = The serial of the Omnik inverter's Wifi module. This the number part only.
 
index e8010521fd1f7d7f6a0014274bdc59e82ced6153..76341eba8b225df61c1b473654bbc54e9c830965 100644 (file)
                                <label>Serial</label>
                                <description>The serial of the Omnik inverter's Wifi module. This the number part only.</description>
                        </parameter>
+                       <parameter name="refreshInterval" type="integer" unit="s" min="5">
+                               <label>Refresh Interval</label>
+                               <description>Interval the device is polled in seconds.</description>
+                               <default>10</default>
+                               <advanced>true</advanced>
+                       </parameter>
                </config-description>
        </thing-type>