Skip to content

Commit

Permalink
[samsungtv] Make use of representation property in discovery (openhab…
Browse files Browse the repository at this point in the history
…#7936)

Contributes to openhab#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 <github@stefantriller.de>
Signed-off-by: Daan Meijer <daan@studioseptember.nl>
  • Loading branch information
t2000 authored and DaanMeijer committed Sep 1, 2020
1 parent 105a82d commit d2c69e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Set<ThingTypeUID> 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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
<channel id="sourceApp" typeId="sourceapp"/>
</channels>

<representation-property>hostName</representation-property>

<config-description-ref uri="thing-type:samsungtv:tv"/>
</thing-type>

Expand Down

0 comments on commit d2c69e4

Please sign in to comment.