From dd687435ec72df880fb8d7337e2619953fc4b069 Mon Sep 17 00:00:00 2001 From: Stefan Triller Date: Mon, 28 Feb 2022 18:53:16 +0100 Subject: [PATCH] [tradfri] use serial as discovery representation property instead of host (#12389) Signed-off-by: Stefan Triller --- .../tradfri/internal/discovery/TradfriDiscoveryParticipant.java | 2 +- .../src/main/resources/OH-INF/thing/thing-types.xml | 2 +- .../internal/discovery/TradfriDiscoveryParticipantOSGITest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipant.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipant.java index e6afe0e6e..bc38ba33b 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipant.java @@ -93,7 +93,7 @@ public class TradfriDiscoveryParticipant implements MDNSDiscoveryParticipant { properties.put(PROPERTY_FIRMWARE_VERSION, fwVersion); } return DiscoveryResultBuilder.create(thingUID).withProperties(properties) - .withLabel("@text/discovery.gateway.label").withRepresentationProperty(GATEWAY_CONFIG_HOST) + .withLabel("@text/discovery.gateway.label").withRepresentationProperty(PROPERTY_SERIAL_NUMBER) .build(); } else { logger.warn("Discovered Tradfri gateway doesn't have an IP address: {}", service); diff --git a/bundles/org.openhab.binding.tradfri/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.tradfri/src/main/resources/OH-INF/thing/thing-types.xml index 445c01f52..db4997129 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.tradfri/src/main/resources/OH-INF/thing/thing-types.xml @@ -8,7 +8,7 @@ IKEA TRÅDFRI IP Gateway - host + serialNumber diff --git a/itests/org.openhab.binding.tradfri.tests/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipantOSGITest.java b/itests/org.openhab.binding.tradfri.tests/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipantOSGITest.java index 98e0c6622..2b3e265eb 100644 --- a/itests/org.openhab.binding.tradfri.tests/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipantOSGITest.java +++ b/itests/org.openhab.binding.tradfri.tests/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipantOSGITest.java @@ -114,7 +114,7 @@ public class TradfriDiscoveryParticipantOSGITest extends JavaOSGiTest { assertThat(result.getProperties().get(Thing.PROPERTY_VENDOR), is("IKEA of Sweden")); assertThat(result.getProperties().get(GATEWAY_CONFIG_HOST), is("192.168.0.5")); assertThat(result.getProperties().get(GATEWAY_CONFIG_PORT), is(1234)); - assertThat(result.getRepresentationProperty(), is(GATEWAY_CONFIG_HOST)); + assertThat(result.getRepresentationProperty(), is(Thing.PROPERTY_SERIAL_NUMBER)); } @Test