]> git.basschouten.com Git - openhab-addons.git/commitdiff
[zway] Code improvements (#14688)
authorlsiepel <leosiepel@gmail.com>
Fri, 31 Mar 2023 07:24:34 +0000 (09:24 +0200)
committerGitHub <noreply@github.com>
Fri, 31 Mar 2023 07:24:34 +0000 (09:24 +0200)
* Code improvements

Signed-off-by: lsiepel <leosiepel@gmail.com>
bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/ZWayHandlerFactory.java
bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayBridgeConfiguration.java
bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayZAutomationDeviceConfiguration.java
bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayZWaveDeviceConfiguration.java
bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/converter/ZWayDeviceStateConverter.java
bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/discovery/ZWayBridgeDiscoveryService.java
bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/discovery/ZWayDeviceDiscoveryService.java
bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayBridgeHandler.java
bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayDeviceHandler.java
bundles/org.openhab.binding.zway/src/main/resources/OH-INF/i18n/zway.properties

index f6d56b2d4978b3d4bab5c101fa4af97e5c497682..f158d7d23487bd78c052579e45339bebad6d6bc4 100644 (file)
@@ -20,6 +20,8 @@ import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
 import org.openhab.binding.zway.internal.discovery.ZWayDeviceDiscoveryService;
 import org.openhab.binding.zway.internal.handler.ZWayBridgeHandler;
 import org.openhab.binding.zway.internal.handler.ZWayZAutomationDeviceHandler;
@@ -41,6 +43,7 @@ import org.osgi.service.component.annotations.Component;
  *
  * @author Patrick Hecker - Initial contribution
  */
+@NonNullByDefault
 @Component(service = ThingHandlerFactory.class, configurationPid = "binding.zway")
 public class ZWayHandlerFactory extends BaseThingHandlerFactory {
 
@@ -56,7 +59,7 @@ public class ZWayHandlerFactory extends BaseThingHandlerFactory {
     }
 
     @Override
-    protected ThingHandler createHandler(Thing thing) {
+    protected @Nullable ThingHandler createHandler(Thing thing) {
         if (ZWayBridgeHandler.SUPPORTED_THING_TYPE.equals(thing.getThingTypeUID())) {
             ZWayBridgeHandler handler = new ZWayBridgeHandler((Bridge) thing);
             registerDeviceDiscoveryService(handler);
index cd4122275c574314e9fb34b06ffe53b2fbcdaec4..9861cc4f9d87d91257ea0012ecf942d0e3bb4232 100644 (file)
@@ -14,22 +14,24 @@ package org.openhab.binding.zway.internal.config;
 
 import static org.openhab.binding.zway.internal.ZWayBindingConstants.*;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
 
 /**
  * The {@link ZWayBridgeConfiguration} class defines the model for a bridge configuration.
  *
  * @author Patrick Hecker - Initial contribution, remove openHAB configuration
  */
+@NonNullByDefault
 public class ZWayBridgeConfiguration {
-    private String zwayServerIpAddress;
-    private Integer zwayServerPort;
-    private String zwayServerProtocol;
+    private String zwayServerIpAddress = "localhost";
+    private Integer zwayServerPort = 8083;
+    private String zwayServerProtocol = "http";
 
-    private String zwayServerUsername;
-    private String zwayServerPassword;
+    private String zwayServerUsername = "admin";
+    private @Nullable String zwayServerPassword;
 
-    private Integer pollingInterval;
+    private Integer pollingInterval = 3600;
 
     public String getZWayIpAddress() {
         return zwayServerIpAddress;
@@ -63,7 +65,7 @@ public class ZWayBridgeConfiguration {
         this.zwayServerUsername = username;
     }
 
-    public String getZWayPassword() {
+    public @Nullable String getZWayPassword() {
         return zwayServerPassword;
     }
 
@@ -81,11 +83,11 @@ public class ZWayBridgeConfiguration {
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this).append(BRIDGE_CONFIG_ZWAY_SERVER_IP_ADDRESS, this.getZWayIpAddress())
-                .append(BRIDGE_CONFIG_ZWAY_SERVER_PORT, this.getZWayPort())
-                .append(BRIDGE_CONFIG_ZWAY_SERVER_PROTOCOL, this.getZWayProtocol())
-                .append(BRIDGE_CONFIG_ZWAY_SERVER_USERNAME, this.getZWayUsername())
-                .append(BRIDGE_CONFIG_ZWAY_SERVER_PASSWORD, this.getZWayPassword())
-                .append(BRIDGE_CONFIG_POLLING_INTERVAL, this.getPollingInterval()).toString();
+        return getClass().getSimpleName() + "{ " + BRIDGE_CONFIG_ZWAY_SERVER_IP_ADDRESS + "=" + getZWayIpAddress()
+                + ", " + BRIDGE_CONFIG_ZWAY_SERVER_PORT + "=" + getZWayPort() + ", "
+                + BRIDGE_CONFIG_ZWAY_SERVER_PROTOCOL + "=" + getZWayProtocol() + ", "
+                + BRIDGE_CONFIG_ZWAY_SERVER_USERNAME + "=" + getZWayUsername() + ", "
+                + BRIDGE_CONFIG_ZWAY_SERVER_PASSWORD + "=" + getZWayPassword() + ", " + BRIDGE_CONFIG_POLLING_INTERVAL
+                + "=" + this.getPollingInterval() + "}";
     }
 }
index 9a92f2184df9e0f0552f842ceaf46b2f844f5cea..d6d4d8ef1f31de767c54ff79d821703a74479071 100644 (file)
@@ -14,26 +14,28 @@ package org.openhab.binding.zway.internal.config;
 
 import static org.openhab.binding.zway.internal.ZWayBindingConstants.DEVICE_CONFIG_VIRTUAL_DEVICE_ID;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
 
 /**
  * The {@link ZWayZAutomationDeviceConfiguration} class defines the model for a Z-Way device configuration.
  *
  * @author Patrick Hecker - Initial contribution
  */
+@NonNullByDefault
 public class ZWayZAutomationDeviceConfiguration {
-    private String deviceId;
+    private @Nullable String deviceId;
 
-    public String getDeviceId() {
+    public @Nullable String getDeviceId() {
         return deviceId;
     }
 
-    public void setDeviceId(String deviceId) {
+    public void setDeviceId(@Nullable String deviceId) {
         this.deviceId = deviceId;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this).append(DEVICE_CONFIG_VIRTUAL_DEVICE_ID, this.getDeviceId()).toString();
+        return getClass().getSimpleName() + "{ " + DEVICE_CONFIG_VIRTUAL_DEVICE_ID + "=" + getDeviceId() + "}";
     }
 }
index 86b802dcbf6504e6608219b5a2a28b51c95fdc37..4cf8f38fcbe4f586d94a8b21ba909774d3a38b5d 100644 (file)
@@ -14,26 +14,28 @@ package org.openhab.binding.zway.internal.config;
 
 import static org.openhab.binding.zway.internal.ZWayBindingConstants.DEVICE_CONFIG_NODE_ID;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
 
 /**
  * The {@link ZWayZWaveDeviceConfiguration} class defines the model for a Z-Wave device configuration.
  *
  * @author Patrick Hecker - Initial contribution
  */
+@NonNullByDefault
 public class ZWayZWaveDeviceConfiguration {
-    private Integer nodeId;
+    private @Nullable Integer nodeId;
 
-    public Integer getNodeId() {
+    public @Nullable Integer getNodeId() {
         return nodeId;
     }
 
-    public void setNodeId(Integer nodeId) {
+    public void setNodeId(@Nullable Integer nodeId) {
         this.nodeId = nodeId;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this).append(DEVICE_CONFIG_NODE_ID, this.getNodeId()).toString();
+        return getClass().getSimpleName() + "{ " + DEVICE_CONFIG_NODE_ID + "=" + getNodeId() + "}";
     }
 }
index 29da0abb17183ecdee8693ee0cf4365f419a146e..be6ae37f8df7b3b7b0bb9e1db00ee4a342dfa322 100644 (file)
@@ -12,6 +12,8 @@
  */
 package org.openhab.binding.zway.internal.converter;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
 import org.openhab.core.library.types.DecimalType;
 import org.openhab.core.library.types.HSBType;
 import org.openhab.core.library.types.OnOffType;
@@ -41,6 +43,7 @@ import de.fh_zwickau.informatik.sensor.model.devices.types.ToggleButton;
  *
  * @author Patrick Hecker - Initial contribution
  */
+@NonNullByDefault
 public class ZWayDeviceStateConverter {
     public static State toState(Device device, Channel channel) {
         // Store level locally
@@ -52,7 +55,7 @@ public class ZWayDeviceStateConverter {
         } else if (device instanceof Doorlock) {
             return getBinaryState(level.toLowerCase());
         } else if (device instanceof SensorBinary) {
-            if (channel.getAcceptedItemType().equals("Contact")) {
+            if ("Contact".equals(channel.getAcceptedItemType())) {
                 return getDoorlockState(level.toLowerCase());
             } else {
                 return getBinaryState(level.toLowerCase());
@@ -62,8 +65,8 @@ public class ZWayDeviceStateConverter {
         } else if (device instanceof SwitchBinary) {
             return getBinaryState(level.toLowerCase());
         } else if (device instanceof SwitchMultilevel) {
-            if (channel.getAcceptedItemType().equals("Rollershutter")
-                    || channel.getAcceptedItemType().equals("Dimmer")) {
+            if ("Rollershutter".equals(channel.getAcceptedItemType())
+                    || "Dimmer".equals(channel.getAcceptedItemType())) {
                 return getPercentState(level);
             } else {
                 return getMultilevelState(level);
@@ -89,14 +92,14 @@ public class ZWayDeviceStateConverter {
      * @param multilevel sensor value
      * @return transformed openHAB state
      */
-    private static State getMultilevelState(String multilevelValue) {
+    private static State getMultilevelState(@Nullable String multilevelValue) {
         if (multilevelValue != null) {
             return new DecimalType(multilevelValue);
         }
         return UnDefType.UNDEF;
     }
 
-    private static State getPercentState(String multilevelValue) {
+    private static State getPercentState(@Nullable String multilevelValue) {
         if (multilevelValue != null) {
             return new PercentType(multilevelValue);
         }
@@ -109,11 +112,11 @@ public class ZWayDeviceStateConverter {
      * @param binary switch value
      * @return transformed openHAB state
      */
-    private static State getBinaryState(String binarySwitchState) {
+    private static State getBinaryState(@Nullable String binarySwitchState) {
         if (binarySwitchState != null) {
-            if (binarySwitchState.equals("on")) {
+            if ("on".equals(binarySwitchState)) {
                 return OnOffType.ON;
-            } else if (binarySwitchState.equals("off")) {
+            } else if ("off".equals(binarySwitchState)) {
                 return OnOffType.OFF;
             }
         }
@@ -128,11 +131,11 @@ public class ZWayDeviceStateConverter {
      * @param binary sensor state
      * @return
      */
-    private static State getDoorlockState(String binarySensorState) {
+    private static State getDoorlockState(@Nullable String binarySensorState) {
         if (binarySensorState != null) {
-            if (binarySensorState.equals("on")) {
+            if ("on".equals(binarySensorState)) {
                 return OpenClosedType.OPEN;
-            } else if (binarySensorState.equals("off")) {
+            } else if ("off".equals(binarySensorState)) {
                 return OpenClosedType.CLOSED;
             }
         }
@@ -145,7 +148,7 @@ public class ZWayDeviceStateConverter {
      * @param Z-Way color value
      * @return transformed openHAB state
      */
-    private static State getColorState(Color colorSwitchState) {
+    private static State getColorState(@Nullable Color colorSwitchState) {
         if (colorSwitchState != null && colorSwitchState.getRed() != null && colorSwitchState.getGreen() != null
                 && colorSwitchState.getBlue() != null) {
             HSBType hsbType = HSBType.fromRGB(colorSwitchState.getRed(), colorSwitchState.getGreen(),
index 8e64425125b1940863b97a740e77997b51eb25ad..31c84f35b72395acf1d7bd6f55a140ce4f95e7c0 100644 (file)
@@ -24,6 +24,7 @@ import java.util.Enumeration;
 import java.util.regex.Pattern;
 
 import org.apache.commons.net.util.SubnetUtils;
+import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.openhab.binding.zway.internal.ZWayBindingConstants;
 import org.openhab.core.config.discovery.AbstractDiscoveryService;
 import org.openhab.core.config.discovery.DiscoveryResult;
@@ -39,6 +40,7 @@ import org.slf4j.LoggerFactory;
  *
  * @author Patrick Hecker - Initial contribution
  */
+@NonNullByDefault
 @Component(service = DiscoveryService.class, configurationPid = "discovery.zway")
 public class ZWayBridgeDiscoveryService extends AbstractDiscoveryService {
 
@@ -124,7 +126,7 @@ public class ZWayBridgeDiscoveryService extends AbstractDiscoveryService {
                             .withLabel("Z-Way Server " + ipAddress).build();
                     thingDiscovered(discoveryResult);
                 }
-            } catch (Exception e) {
+            } catch (IOException e) {
                 logger.warn("Discovery resulted in an unexpected exception", e);
             }
         }
index 58027ae10cf94491bfe6dbd38f3ac977dd46895c..ffb0cc884b99cec091413d97756520facdd028a1 100644 (file)
@@ -17,6 +17,8 @@ import java.util.Map;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
 
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
 import org.openhab.binding.zway.internal.ZWayBindingConstants;
 import org.openhab.binding.zway.internal.handler.ZWayBridgeHandler;
 import org.openhab.core.config.discovery.AbstractDiscoveryService;
@@ -41,6 +43,7 @@ import de.fh_zwickau.informatik.sensor.model.zwaveapi.devices.ZWaveDevice;
  *
  * @author Patrick Hecker - Initial contribution
  */
+@NonNullByDefault
 public class ZWayDeviceDiscoveryService extends AbstractDiscoveryService {
 
     private final Logger logger = LoggerFactory.getLogger(getClass());
@@ -51,7 +54,7 @@ public class ZWayDeviceDiscoveryService extends AbstractDiscoveryService {
 
     private ZWayBridgeHandler mBridgeHandler;
     private ZWayDeviceScan mZWayDeviceScanningRunnable;
-    private ScheduledFuture<?> mZWayDeviceScanningJob;
+    private @Nullable ScheduledFuture<?> mZWayDeviceScanningJob;
 
     public ZWayDeviceDiscoveryService(ZWayBridgeHandler bridgeHandler) {
         super(ZWayBindingConstants.SUPPORTED_DEVICE_THING_TYPES_UIDS, SEARCH_TIME);
@@ -65,7 +68,7 @@ public class ZWayDeviceDiscoveryService extends AbstractDiscoveryService {
         logger.debug("Starting scan on Z-Way Server {}", mBridgeHandler.getThing().getUID());
 
         // Z-Way bridge have to be ONLINE because configuration is needed
-        if (mBridgeHandler == null || !mBridgeHandler.getThing().getStatus().equals(ThingStatus.ONLINE)) {
+        if (!mBridgeHandler.getThing().getStatus().equals(ThingStatus.ONLINE)) {
             logger.debug("Z-Way bridge handler not found or not ONLINE.");
             return;
         }
@@ -213,7 +216,8 @@ public class ZWayDeviceDiscoveryService extends AbstractDiscoveryService {
 
     @Override
     protected void startBackgroundDiscovery() {
-        if (mZWayDeviceScanningJob == null || mZWayDeviceScanningJob.isCancelled()) {
+        ScheduledFuture<?> mZWayDeviceScanningJobLocal = mZWayDeviceScanningJob;
+        if (mZWayDeviceScanningJobLocal == null || mZWayDeviceScanningJobLocal.isCancelled()) {
             logger.debug("Starting background scanning job");
             mZWayDeviceScanningJob = scheduler.scheduleWithFixedDelay(mZWayDeviceScanningRunnable, INITIAL_DELAY,
                     SCAN_INTERVAL, TimeUnit.SECONDS);
@@ -224,8 +228,9 @@ public class ZWayDeviceDiscoveryService extends AbstractDiscoveryService {
 
     @Override
     protected void stopBackgroundDiscovery() {
-        if (mZWayDeviceScanningJob != null && !mZWayDeviceScanningJob.isCancelled()) {
-            mZWayDeviceScanningJob.cancel(false);
+        ScheduledFuture<?> mZWayDeviceScanningJobLocal = mZWayDeviceScanningJob;
+        if (mZWayDeviceScanningJobLocal != null && !mZWayDeviceScanningJobLocal.isCancelled()) {
+            mZWayDeviceScanningJobLocal.cancel(false);
             mZWayDeviceScanningJob = null;
         }
     }
index e9e39e0f6795c8e5505c62b8081119bda02a7969..9810e4d4542fcfd197b250ce5f6a950aaf7a1eef 100644 (file)
@@ -387,18 +387,13 @@ public class ZWayBridgeHandler extends BaseBridgeHandler implements IZWayApiCall
 
         // Z-Way IP address
         String zWayIpAddress = config.getZWayIpAddress();
-        if (zWayIpAddress == null || zWayIpAddress.isBlank()) {
+        if (zWayIpAddress.isBlank()) {
             config.setZWayIpAddress("localhost"); // default value
         }
 
-        // Z-Way Port
-        if (config.getZWayPort() == null) {
-            config.setZWayPort(8083);
-        }
-
         // Z-Way Protocol
         String zWayProtocol = config.getZWayProtocol();
-        if (zWayProtocol == null || zWayProtocol.isBlank()) {
+        if (zWayProtocol.isBlank()) {
             config.setZWayProtocol("http");
         }
 
@@ -412,19 +407,10 @@ public class ZWayBridgeHandler extends BaseBridgeHandler implements IZWayApiCall
 
         // Z-Way Username
         String zWayUsername = config.getZWayUsername();
-        if (zWayUsername == null || zWayUsername.isBlank()) {
+        if (zWayUsername.isBlank()) {
             config.setZWayUsername("admin"); // default value
         }
 
-        /***********************************
-         ****** General configuration ******
-         **********************************/
-
-        // Polling interval
-        if (config.getPollingInterval() == null) {
-            config.setPollingInterval(3600);
-        }
-
         return config;
     }
 
index 4c5464422ef83e4ebd2799f308eebe429b9f49c1..b65632269f22749e37044643c631e9bbd650471f 100644 (file)
@@ -257,7 +257,7 @@ public abstract class ZWayDeviceHandler extends BaseThingHandler {
         Map<String, String> properties = getThing().getProperties();
         // Load location from properties
         String location = properties.get(ZWayBindingConstants.DEVICE_PROP_LOCATION);
-        if (location != null && !location.equals("") && getThing().getLocation() == null) {
+        if (location != null && !location.isBlank() && getThing().getLocation() == null) {
             logger.debug("Set location to {}", location);
             ThingBuilder thingBuilder = editThing();
             thingBuilder.withLocation(location);
@@ -371,7 +371,7 @@ public abstract class ZWayDeviceHandler extends BaseThingHandler {
 
         // Load device id from channel's properties for the compatibility of ZAutomation and ZWave devices
         final Channel channel = getThing().getChannel(channelUID.getId());
-        final String deviceId = channel.getProperties().get("deviceId");
+        final String deviceId = channel != null ? channel.getProperties().get("deviceId") : null;
 
         if (deviceId != null) {
             DeviceList deviceList = zwayBridgeHandler.getDeviceList();
@@ -707,7 +707,7 @@ public abstract class ZWayDeviceHandler extends BaseThingHandler {
             }
 
             // If at least one rule could mapped to a channel
-            if (!id.equals("")) {
+            if (!id.isBlank()) {
                 addChannel(id, acceptedItemType, device.getMetrics().getTitle(), properties);
 
                 logger.debug(
index 2ca37a4ce3f34525cb627a7c0b93e2fd66c50d1e..9b766e06e91da16950b3e20672b52b2ff696c90f 100644 (file)
 # add-on
+
 addon.zway.name = Z-Way Binding
 addon.zway.description = Z-Way is a home automation software to configure and control a Z-Wave network. The ZAutomation interface provides all Z-Wave devices and handles incoming commands. The Z-Way Binding uses this HTTP interface to load all device and make them available during the discovery process.<br> Currently only a continuous polling is available!
 
 # thing types
-thing-type.zway.zwayServer.label = Z-Way Server
-thing-type.zway.zwayServer.description = The Z-Way server represents a bridge with general settings and communication tasks.
-
-thing-type.config.zway.zwayServer.zwayServer.label = Z-Way server
-thing-type.config.zway.zwayServer.zwayServer.description = The configuration of the Z-Way server. Except for the username and password all the information detected during the discovery.
-thing-type.config.zway.zwayServer.binding.label = Options
-thing-type.config.zway.zwayServer.binding.description = These settings affect functions of the binding.
-
-thing-type.config.zway.zwayServer.zwayServerIpAddress.label = IP address
-thing-type.config.zway.zwayServer.zwayServerIpAddress.description = The IP address or hostname of the Z-Way server. If Z-Way and openHAB are running on the same machine, the default value can be used.
-thing-type.config.zway.zwayServer.zwayServerPort.label = Port
-thing-type.config.zway.zwayServer.zwayServerPort.description = The port of the Z-Way server
-thing-type.config.zway.zwayServer.zwayServerProtocol.label = Protocol
-thing-type.config.zway.zwayServer.zwayServerProtocol.description = Protocol to connect to the Z-Way server (http or https)
-thing-type.config.zway.zwayServer.zwayServerUsername.label = Username
-thing-type.config.zway.zwayServer.zwayServerUsername.description = Username to access the Z-Way server.
-thing-type.config.zway.zwayServer.zwayServerPassword.label = Password
-thing-type.config.zway.zwayServer.zwayServerPassword.description = Password to access the Z-Way server.
-
-thing-type.config.zway.zwayServer.pollingInterval.label = Polling Interval
-thing-type.config.zway.zwayServer.pollingInterval.description = Refresh device states and registration from Z-Way server.
 
 thing-type.zway.zwayDevice.label = Z-Wave Device
 thing-type.zway.zwayDevice.description = A Z-Wave device represents a device of real world. Each device function will be mapped to a separate channel. The bridge is necessary as an intermediary between openHAB thing and Z-Way device.
-
-thing-type.config.zway.zwayDevice.nodeId.label = Node Id
-thing-type.config.zway.zwayDevice.nodeId.description = Node Id of the Z-Wave device
-
+thing-type.zway.zwayServer.label = Z-Way Server
+thing-type.zway.zwayServer.description = The Z-Way server represents a bridge with general settings and communication tasks.
 thing-type.zway.zwayVirtualDevice.label = Z-Way Virtual Device
 thing-type.zway.zwayVirtualDevice.description = A Z-Way virtual device represents one sensor, actor or Z-Way App with the corresponding channel. The bridge is necessary as an intermediary between openHAB thing and Z-Way device.
 
+# thing types config
+
+bridge-type.config.zway.zwayServer.group.binding.label = Options
+bridge-type.config.zway.zwayServer.group.binding.description = These settings affect functions of the binding.
+bridge-type.config.zway.zwayServer.group.zwayServer.label = Z-Way Server
+bridge-type.config.zway.zwayServer.group.zwayServer.description = The configuration of the Z-Way server. Except for the username and password all the information detected during the discovery.
+bridge-type.config.zway.zwayServer.pollingInterval.label = Polling Interval
+bridge-type.config.zway.zwayServer.pollingInterval.description = Refresh device states and registration from Z-Way server.
+bridge-type.config.zway.zwayServer.zwayServerIpAddress.label = IP Address
+bridge-type.config.zway.zwayServer.zwayServerIpAddress.description = The IP address or hostname of the Z-Way server. If Z-Way and openHAB are running on the same machine, the default value can be used.
+bridge-type.config.zway.zwayServer.zwayServerPassword.label = Password
+bridge-type.config.zway.zwayServer.zwayServerPassword.description = Password to access the Z-Way server.
+bridge-type.config.zway.zwayServer.zwayServerPort.label = Port
+bridge-type.config.zway.zwayServer.zwayServerPort.description = The port of the Z-Way server
+bridge-type.config.zway.zwayServer.zwayServerProtocol.label = Protocol
+bridge-type.config.zway.zwayServer.zwayServerProtocol.description = Protocol to connect to the Z-Way server (http or https)
+bridge-type.config.zway.zwayServer.zwayServerProtocol.option.http = HTTP
+bridge-type.config.zway.zwayServer.zwayServerProtocol.option.https = HTTPS
+bridge-type.config.zway.zwayServer.zwayServerUsername.label = Username
+bridge-type.config.zway.zwayServer.zwayServerUsername.description = Username to access the Z-Way server.
+thing-type.config.zway.zwayDevice.nodeId.label = Node Id
+thing-type.config.zway.zwayDevice.nodeId.description = Node Id of the Z-Wave device
 thing-type.config.zway.zwayVirtualDevice.deviceId.label = Device Id
 thing-type.config.zway.zwayVirtualDevice.deviceId.description = Device Id of virtual device
 
 # channel types
-channel-type.zway.sensorTemperature.label = Temperature
-channel-type.zway.sensorLuminosity.label = Luminiscence
-channel-type.zway.sensorHumidity.label = Humidity
+
+channel-type.zway.actions.label = Actions
+channel-type.zway.actions.description = Available actions of the Z-Wave Controller
+channel-type.zway.actions.state.option.REFRESH = Refresh all things
+channel-type.zway.battery.label = Battery
+channel-type.zway.doorlock.label = Doorlock
+channel-type.zway.exclusion.label = Exclusion
+channel-type.zway.exclusion.description = Start exclusion mode (after a timeout the exclusion will be automatically finished).
+channel-type.zway.inclusion.label = Inclusion
+channel-type.zway.inclusion.description = Start inclusion mode (after a timeout the inclusion will be automatically finished).
+channel-type.zway.secureInclusion.label = Secure Inclusion
+channel-type.zway.secureInclusion.description = Change inclusion type for further inclusions.
 channel-type.zway.sensorBarometer.label = Barometer
-channel-type.zway.sensorUltraviolet.label = Ultraviolet
-channel-type.zway.sensorCO2.label = CarbonDioxide
+channel-type.zway.sensorBinary.label = Sensor Binary
+channel-type.zway.sensorBinary.description = This channel represents a universal channel if no further device information is available.
+channel-type.zway.sensorCO2.label = CO2
+channel-type.zway.sensorCo.label = Gas
+channel-type.zway.sensorDiscrete.label = Sensor Discrete
+channel-type.zway.sensorDiscrete.description = This channel represents a two-digit value. The first digit is the button/scene number and the second digit points to action/keyAttribute (have a look at http://z-wave.sigmadesigns.com/wp-content/uploads/2016/08/SDS12657-12-Z-Wave-Command-Class-Specification-A-M.pdf, p. 153).
+channel-type.zway.sensorDoorWindow.label = DoorWindow
 channel-type.zway.sensorEnergy.label = Energy
+channel-type.zway.sensorFlood.label = Flood
+channel-type.zway.sensorHumidity.label = Humidity
+channel-type.zway.sensorLuminosity.label = Luminiscence
 channel-type.zway.sensorMeterKWh.label = Energy
 channel-type.zway.sensorMeterW.label = Energy
+channel-type.zway.sensorMotion.label = Motion
+channel-type.zway.sensorMultilevel.label = Sensor Multilevel
+channel-type.zway.sensorMultilevel.description = This channel represents a universal channel if no further device information is available.
 channel-type.zway.sensorSmoke.label = Smoke
-channel-type.zway.sensorCo.label = Gas
-channel-type.zway.sensorFlood.label = Flood
 channel-type.zway.sensorTamper.label = Tamper
-channel-type.zway.sensorDoorWindow.label = DoorWindow
-channel-type.zway.sensorMotion.label = Motion
-channel-type.zway.switchPowerOutlet.label = PowerOutlet
+channel-type.zway.sensorTemperature.label = Temperature
+channel-type.zway.sensorUltraviolet.label = Ultraviolet
+channel-type.zway.switchBinary.label = Switch Binary
+channel-type.zway.switchBinary.description = This channel represents a universal channel if no further device information is available.
+channel-type.zway.switchBlinds.label = Rollshutter
+channel-type.zway.switchColor.label = Switch Color
+channel-type.zway.switchColor.description = This channel represents the rgbw switch device type from Z-Way.
 channel-type.zway.switchColorTemperature.label = Color Temperature
-
-# channel type without further information
-channel-type.zway.battery.label = Battery
-channel-type.zway.doorlock.label = Doorlock
-channel-type.zway.sensorBinary.label = Sensor binary
-channel-type.zway.sensorBinary.description = This channel represents a universal channel if no further device information is available.
-channel-type.zway.sensorMultilevel.label = Sensor multilevel
-channel-type.zway.sensorMultilevel.description = This channel represents a universal channel if no further device information is available.
-channel-type.zway.switchBinary.label = Switch binary
-channel-type.zway.switchBinary.description = This channel represents a universal channel if no further device information is available. 
-channel-type.zway.switchMultilevel.label = Switch multilevel
-channel-type.zway.switchMultilevel.description = This channel represents a universal channel if no further device information is available. 
-channel-type.zway.switchColor.label = Switch color
-channel-type.zway.switchColor.description = This channel represents the RGBW switch device type from Z-Way.
-channel-type.zway.switchControl.label = Switch control
+channel-type.zway.switchControl.label = Switch Control
 channel-type.zway.switchControl.description = This channel represents a universal channel if no further device information is available.
-channel-type.zway.sensorDiscrete.label = Sensor discrete
-channel-type.zway.sensorDiscrete.description = This channel represents a two-digit value. The first digit is the button/scene number and the second digit points to action/keyAttribute (have a look at http://z-wave.sigmadesigns.com/wp-content/uploads/2016/08/SDS12657-12-Z-Wave-Command-Class-Specification-A-M.pdf, p. 153).
-channel-type.zway.thermostatMode.label = Thermostat mode
+channel-type.zway.switchMultilevel.label = Switch Multilevel
+channel-type.zway.switchMultilevel.description = This channel represents a universal channel if no further device information is available.
+channel-type.zway.switchPowerOutlet.label = PowerOutlet
+channel-type.zway.thermostatMode.label = Thermostat Mode
 channel-type.zway.thermostatMode.description = The channel allows the control or display of a thermostat (mode). A thermostat can have up to three states (modes): off, heating and cooling. The state of heating and cooling is alternately set at the state on.
-channel-type.zway.thermostatSetPoint.label = Thermostat set point
+channel-type.zway.thermostatModeCC.label = Thermostat Mode (Command Class)
+channel-type.zway.thermostatModeCC.description = The channel allows the control or display of a thermostat (mode) from command class. The modes differ from device to device.
+channel-type.zway.thermostatSetPoint.label = Thermostat Set Point
 
-channel-type.zway.thermostatModeV2.label = Thermostat mode (Command Class)
-channel-type.zway.thermostatModeV2.description = The channel allows the control or display of a thermostat (mode) from command class. The modes differ from device to device.
+# thing types
 
-channel-type.zway.actions.label = Actions
-channel-type.zway.actions.description = Available actions of the Z-Wave Controller
-channel-type.zway.actions.option.REFRESH = Refresh all things
+thing-type.config.zway.zwayServer.pollingInterval.label = Polling Interval
+thing-type.config.zway.zwayServer.pollingInterval.description = Refresh device states and registration from Z-Way server.
+thing-type.config.zway.zwayServer.zwayServer.label = Z-Way server
+thing-type.config.zway.zwayServer.zwayServer.description = The configuration of the Z-Way server. Except for the username and password all the information detected during the discovery.
+thing-type.config.zway.zwayServer.binding.label = Options
+thing-type.config.zway.zwayServer.binding.description = These settings affect functions of the binding.
+thing-type.config.zway.zwayServer.zwayServerIpAddress.label = IP address
+thing-type.config.zway.zwayServer.zwayServerIpAddress.description = The IP address or hostname of the Z-Way server. If Z-Way and openHAB are running on the same machine, the default value can be used.
+thing-type.config.zway.zwayServer.zwayServerPort.label = Port
+thing-type.config.zway.zwayServer.zwayServerPort.description = The port of the Z-Way server
+thing-type.config.zway.zwayServer.zwayServerProtocol.label = Protocol
+thing-type.config.zway.zwayServer.zwayServerProtocol.description = Protocol to connect to the Z-Way server (http or https)
+thing-type.config.zway.zwayServer.zwayServerUsername.label = Username
+thing-type.config.zway.zwayServer.zwayServerUsername.description = Username to access the Z-Way server.
+thing-type.config.zway.zwayServer.zwayServerPassword.label = Password
+thing-type.config.zway.zwayServer.zwayServerPassword.description = Password to access the Z-Way server.
 
-channel-type.zway.secureInclusion.label = Secure inclusion
-channel-type.zway.secureInclusion.description = Change inclusion type for further inclusions.
-channel-type.zway.inclusion.label = Inclusion
-channel-type.zway.inclusion.description = Start inclusion mode (after a timeout the inclusion will be automatically finished).
-channel-type.zway.exclusion.label = Exclusion
-channel-type.zway.exclusion.description = Start exclusion mode (after a timeout the exclusion will be automatically finished).
+# channel type without further information
+
+channel-type.zway.actions.option.REFRESH = Refresh all things
+channel-type.zway.thermostatModeV2.label = Thermostat mode (Command Class)
+channel-type.zway.thermostatModeV2.description = The channel allows the control or display of a thermostat (mode) from command class. The modes differ from device to device.