Fix wrong usage of representationProperty (#8793)

Signed-off-by: Jochen Klein <git@jochen.susca.de>
This commit is contained in:
Jochen Klein 2020-10-18 19:43:47 +02:00 committed by GitHub
parent 459ee8d7cd
commit 42d1c26912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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() {