import static org.openhab.core.thing.Thing.PROPERTY_VENDOR;
import java.util.Dictionary;
-import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.openhab.core.config.discovery.DiscoveryResult;
import org.openhab.core.config.discovery.DiscoveryResultBuilder;
import org.openhab.core.config.discovery.upnp.UpnpDiscoveryParticipant;
+import org.openhab.core.config.discovery.upnp.internal.UpnpDiscoveryService;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.ThingUID;
import org.osgi.service.component.ComponentContext;
if (uid != null) {
logger.debug("discovered: {} ({}) at {}", device.getDisplayString(),
device.getDetails().getFriendlyName(), device.getIdentity().getDescriptorURL().getHost());
-
- Map<String, Object> properties = new HashMap<>();
- properties.put(CONFIG_IP_ADDRESS, device.getIdentity().getDescriptorURL().getHost());
- properties.put(PROPERTY_VENDOR, device.getDetails().getManufacturerDetails().getManufacturer());
-
- DiscoveryResult result = DiscoveryResultBuilder.create(uid).withProperties(properties)
+ return DiscoveryResultBuilder.create(uid)
+ .withProperties(Map.of(CONFIG_IP_ADDRESS, device.getIdentity().getDescriptorURL().getHost(),
+ PROPERTY_VENDOR, device.getDetails().getManufacturerDetails().getManufacturer()))
.withLabel(device.getDetails().getFriendlyName()).withRepresentationProperty(CONFIG_IP_ADDRESS)
.build();
-
- return result;
}
}
return null;
<channel id="apply_template" typeId="apply_template"/>
</channels>
+ <representation-property>ipAddress</representation-property>
+
<config-description-ref uri="bridge-type:avmfritz:fritzbox"/>
</bridge-type>
<channel id="outlet" typeId="outlet"/>
</channels>
+ <representation-property>ipAddress</representation-property>
+
<config-description-ref uri="bridge-type:avmfritz:fritzpowerline"/>
</bridge-type>
</thing:thing-descriptions>