diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/discovery/ThingDiscoveryService.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/discovery/ThingDiscoveryService.java index 6c17917758a49..998373595ff31 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/discovery/ThingDiscoveryService.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/discovery/ThingDiscoveryService.java @@ -114,14 +114,17 @@ private void addLight(String lightID, LightMessage light) { } Map properties = new HashMap<>(); + properties.put("id", lightType); + properties.put(UNIQUE_ID, light.uniqueid); + properties.put(Thing.PROPERTY_FIRMWARE_VERSION, light.swversion); properties.put(Thing.PROPERTY_FIRMWARE_VERSION, light.swversion); properties.put(Thing.PROPERTY_VENDOR, light.manufacturername); properties.put(Thing.PROPERTY_MODEL_ID, light.modelid); - if (light.ctmax != null) + if (light.ctmax != null && light.ctmin != null) { properties.put(PROPERTY_CT_MAX, Integer.toString(light.ctmax)); - if (light.ctmin != null) properties.put(PROPERTY_CT_MIN, Integer.toString(light.ctmin)); + } switch (lightType) { case ON_OFF_LIGHT: @@ -160,8 +163,6 @@ private void addLight(String lightID, LightMessage light) { ThingUID uid = new ThingUID(thingTypeUID, bridgeUID, light.uniqueid.replaceAll("[^a-z0-9\\[\\]]", "")); DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(uid).withBridge(bridgeUID) .withLabel(light.name + " (" + light.manufacturername + ")") - .withProperty("id", lightID) - .withProperty(UNIQUE_ID, light.uniqueid) .withProperties(properties) .withRepresentationProperty(UNIQUE_ID) .build();