[tradfri] use serial as discovery representation property instead of host (#12389)
Signed-off-by: Stefan Triller <github@stefantriller.de>
This commit is contained in:
parent
166e4ec1b6
commit
dd687435ec
|
@ -93,7 +93,7 @@ public class TradfriDiscoveryParticipant implements MDNSDiscoveryParticipant {
|
||||||
properties.put(PROPERTY_FIRMWARE_VERSION, fwVersion);
|
properties.put(PROPERTY_FIRMWARE_VERSION, fwVersion);
|
||||||
}
|
}
|
||||||
return DiscoveryResultBuilder.create(thingUID).withProperties(properties)
|
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();
|
.build();
|
||||||
} else {
|
} else {
|
||||||
logger.warn("Discovered Tradfri gateway doesn't have an IP address: {}", service);
|
logger.warn("Discovered Tradfri gateway doesn't have an IP address: {}", service);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<label>TRÅDFRI Gateway</label>
|
<label>TRÅDFRI Gateway</label>
|
||||||
<description>IKEA TRÅDFRI IP Gateway</description>
|
<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"/>
|
<config-description-ref uri="bridge-type:tradfri:gateway"/>
|
||||||
</bridge-type>
|
</bridge-type>
|
||||||
|
|
|
@ -114,7 +114,7 @@ public class TradfriDiscoveryParticipantOSGITest extends JavaOSGiTest {
|
||||||
assertThat(result.getProperties().get(Thing.PROPERTY_VENDOR), is("IKEA of Sweden"));
|
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_HOST), is("192.168.0.5"));
|
||||||
assertThat(result.getProperties().get(GATEWAY_CONFIG_PORT), is(1234));
|
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
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue