mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[hdpowerview] discovery could wrongly return a ThingUID based on a hub's Ipv6 address instead of its Ipv4 address (#8778)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This commit is contained in:
parent
5fd82c5aa3
commit
5fe7cc5810
@ -75,7 +75,9 @@ public class HDPowerViewHubDiscoveryParticipant implements MDNSDiscoveryParticip
|
||||
@Override
|
||||
public @Nullable ThingUID getThingUID(ServiceInfo service) {
|
||||
for (String host : service.getHostAddresses()) {
|
||||
return new ThingUID(THING_TYPE_HUB, host.replace('.', '_'));
|
||||
if (VALID_IP_V4_ADDRESS.matcher(host).matches()) {
|
||||
return new ThingUID(THING_TYPE_HUB, host.replace('.', '_'));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user