]> git.basschouten.com Git - openhab-addons.git/commitdiff
Fix wrong usage of representationProperty (#8793)
authorJochen Klein <git@jochen.susca.de>
Sun, 18 Oct 2020 17:43:47 +0000 (19:43 +0200)
committerGitHub <noreply@github.com>
Sun, 18 Oct 2020 17:43:47 +0000 (19:43 +0200)
Signed-off-by: Jochen Klein <git@jochen.susca.de>
bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/discovery/HomeAssistantDiscovery.java

index 56319555d60ff05c902019e828389c180fd35cb8..948f3c8849706740b65047a55d4a4addeee68137 100644 (file)
@@ -177,12 +177,13 @@ public class HomeAssistantDiscovery extends AbstractMQTTDiscovery {
         HandlerConfiguration handlerConfig = new HandlerConfiguration(haID.baseTopic, topics);
         properties = handlerConfig.appendToProperties(properties);
         properties = config.appendToProperties(properties);
+        properties.put("deviceId", thingID);
 
         // Because we need the new properties map with the updated "components" list
         results.put(thingUID.getAsString(),
-                DiscoveryResultBuilder.create(thingUID).withProperties(properties).withRepresentationProperty(thingID)
-                        .withBridge(connectionBridge).withLabel(config.getThingName() + " (" + componentNames + ")")
-                        .build());
+                DiscoveryResultBuilder.create(thingUID).withProperties(properties)
+                        .withRepresentationProperty("deviceId").withBridge(connectionBridge)
+                        .withLabel(config.getThingName() + " (" + componentNames + ")").build());
     }
 
     protected void publishResults() {