diff --git a/src/main/java/org/openhab/binding/zwave/internal/ZWaveConfigProvider.java b/src/main/java/org/openhab/binding/zwave/internal/ZWaveConfigProvider.java index c67fa62ea..51d73707b 100644 --- a/src/main/java/org/openhab/binding/zwave/internal/ZWaveConfigProvider.java +++ b/src/main/java/org/openhab/binding/zwave/internal/ZWaveConfigProvider.java @@ -290,6 +290,8 @@ public ConfigDescription getConfigDescription(URI uri, Locale locale) { for (int code = 1; code <= userCodeClass.getNumberOfSupportedCodes(); code++) { UserCode userCode = userCodeClass.getCachedUserCode(code); + boolean readOnly = + userCode != null && userCode.getState() == UserIdStatusType.RESERVED_BY_ADMINISTRATOR; parameters.add(ConfigDescriptionParameterBuilder .create(ZWaveBindingConstants.CONFIGURATION_USERCODE_LABEL + code, Type.TEXT) .withLabel("Code " + code + " Label").withDescription("Name for user code " + code) @@ -297,7 +299,7 @@ public ConfigDescription getConfigDescription(URI uri, Locale locale) { parameters.add(ConfigDescriptionParameterBuilder .create(ZWaveBindingConstants.CONFIGURATION_USERCODE_CODE + code, Type.TEXT) .withLabel("Code " + code).withDescription("Set the user code (4 to 10 numbers)") - .withReadOnly(userCode.getState() == UserIdStatusType.RESERVED_BY_ADMINISTRATOR) + .withReadOnly(readOnly) .withGroupName("usercode").build()); } }