]> git.basschouten.com Git - openhab-addons.git/commitdiff
[tradfri] use serial as discovery representation property instead of host (#12389)
authorStefan Triller <t2000@users.noreply.github.com>
Mon, 28 Feb 2022 17:53:16 +0000 (18:53 +0100)
committerGitHub <noreply@github.com>
Mon, 28 Feb 2022 17:53:16 +0000 (18:53 +0100)
Signed-off-by: Stefan Triller <github@stefantriller.de>
bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipant.java
bundles/org.openhab.binding.tradfri/src/main/resources/OH-INF/thing/thing-types.xml
itests/org.openhab.binding.tradfri.tests/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipantOSGITest.java

index e6afe0e6e096549a74b94a4e84e67165bb6b9d49..bc38ba33b46888e23b4a375d98d0298f8e1d694c 100644 (file)
@@ -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);
index 445c01f52f882b38889c2fcd1c414d36494df9ef..db49971291b8626325671233a13ff5e124094742 100644 (file)
@@ -8,7 +8,7 @@
                <label>TRÅDFRI Gateway</label>
                <description>IKEA TRÅDFRI IP Gateway</description>
 
-               <representation-property>host</representation-property>
+               <representation-property>serialNumber</representation-property>
 
                <config-description-ref uri="bridge-type:tradfri:gateway"/>
        </bridge-type>
index 98e0c6622438f4359046a74f7e54ae0fa87a4999..2b3e265ebf33fdcd3cfa0cda6fb1bcd5c137abc5 100644 (file)
@@ -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