fixed n-upnp discovery
This commit is contained in:
parent
14f0519547
commit
1071bcb34b
@ -87,9 +87,10 @@ void IntegrationPluginPhilipsHue::init()
|
|||||||
QString thingId = thing->paramValue(bridgeThingIdParamTypeId).toString();
|
QString thingId = thing->paramValue(bridgeThingIdParamTypeId).toString();
|
||||||
if (entry.protocol() == QAbstractSocket::IPv4Protocol) {
|
if (entry.protocol() == QAbstractSocket::IPv4Protocol) {
|
||||||
|
|
||||||
foreach (const QString &txtEntry, entry.txt()) {
|
QString name = entry.name().split(" - ").first();
|
||||||
QStringList parts = txtEntry.split('=');
|
QString id = entry.name().split(" - ").last();
|
||||||
if (parts.length() == 2 && parts.first() == "uuid" && parts.last() == thingId) {
|
|
||||||
|
if (thingId.contains(id)) {
|
||||||
thing->setParamValue(bridgeThingHostParamTypeId, entry.hostAddress().toString());
|
thing->setParamValue(bridgeThingHostParamTypeId, entry.hostAddress().toString());
|
||||||
HueBridge *bridge = m_bridges.key(thing);
|
HueBridge *bridge = m_bridges.key(thing);
|
||||||
bridge->setHostAddress(entry.hostAddress());
|
bridge->setHostAddress(entry.hostAddress());
|
||||||
@ -97,7 +98,6 @@ void IntegrationPluginPhilipsHue::init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user