]> git.basschouten.com Git - openhab-addons.git/commitdiff
Properly handle when zm installed on root directory (#12348)
authorMark Hilbush <mark@hilbush.com>
Tue, 22 Feb 2022 23:38:02 +0000 (18:38 -0500)
committerGitHub <noreply@github.com>
Tue, 22 Feb 2022 23:38:02 +0000 (00:38 +0100)
Signed-off-by: Mark Hilbush <mark@hilbush.com>
bundles/org.openhab.binding.zoneminder/README.md
bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZmBridgeHandler.java

index efd8e2a1569ddc81153863295d610e7a3a38cac5..ee0e75e7dd41e1e8aa2330c0cab205afe15a0ea1 100644 (file)
@@ -48,7 +48,7 @@ The following configuration parameters are available on the Server thing:
 | Host                           | host                        | Required  | Host name or IP address of the ZoneMinder server. |
 | Use secure connection          | useSSL                      | Required  | Use http or https for connection to ZoneMinder. Default is http. |
 | Port Number                    | portNumber                  | Optional  | Port number if not on ZoneMinder default port 80. |
-| Url Path                       | urlPath                     | Required  | Path where Zoneminder is installed. Default is /zm. |
+| Url Path                       | urlPath                     | Required  | Path where Zoneminder is installed. Default is /zm. Enter / if Zoneminder is installed under root directory. |
 | Refresh Interval               | refreshInterval             | Required  | Frequency in seconds at which monitor status will be updated. |
 | Default Alarm Duration         | defaultAlarmDuration        | Required  | Can be used to set the default alarm duration on discovered monitors. |
 | Default Image Refresh Interval | defaultImageRefreshInterval | Optional  | Can be used to set the image refresh interval in seconds on discovered monitors. Leave empty to not set an image refresh interval. |
index a6de53db4450d0a9470ddfb102ea9f8bc6984325..8fa1093e966ec71222c19f7e168852a0817ccb53 100644 (file)
@@ -146,7 +146,7 @@ public class ZmBridgeHandler extends BaseBridgeHandler {
         host = config.host;
         useSSL = config.useSSL.booleanValue();
         portNumber = config.portNumber != null ? Integer.toString(config.portNumber) : null;
-        urlPath = config.urlPath;
+        urlPath = "/".equals(config.urlPath) ? "" : config.urlPath;
 
         // If user and password are configured, then use Zoneminder authentication
         if (config.user != null && config.pass != null) {