From 345e16b1b50c6db4aed3278806013dbc2d9ba475 Mon Sep 17 00:00:00 2001 From: t2000 Date: Thu, 18 Jun 2020 21:05:28 +0200 Subject: [PATCH] [samsungtv] Make use of representation property in discovery (#7936) Contributes to #6317 and should hide a result if there is already a thing defined which does not have the same ThingUID but points to the same TV. Signed-off-by: Stefan Triller --- .../internal/discovery/SamsungTvDiscoveryParticipant.java | 2 +- .../src/main/resources/ESH-INF/thing/thing-types.xml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/discovery/SamsungTvDiscoveryParticipant.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/discovery/SamsungTvDiscoveryParticipant.java index 4bc16cb1fe1b4..cd67d3c682ba1 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/discovery/SamsungTvDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/discovery/SamsungTvDiscoveryParticipant.java @@ -57,7 +57,7 @@ public Set getSupportedThingTypeUIDs() { properties.put(HOST_NAME, device.getIdentity().getDescriptorURL().getHost()); DiscoveryResult result = DiscoveryResultBuilder.create(uid).withProperties(properties) - .withLabel(getLabel(device)).build(); + .withRepresentationProperty(HOST_NAME).withLabel(getLabel(device)).build(); logger.debug("Created a DiscoveryResult for device '{}' with UDN '{}' and properties: {}", device.getDetails().getModelDetails().getModelName(), diff --git a/bundles/org.openhab.binding.samsungtv/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.samsungtv/src/main/resources/ESH-INF/thing/thing-types.xml index 34ced773ef24e..a06e47b38a081 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.samsungtv/src/main/resources/ESH-INF/thing/thing-types.xml @@ -28,6 +28,8 @@ + hostName +