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();
|
||||
if (entry.protocol() == QAbstractSocket::IPv4Protocol) {
|
||||
|
||||
foreach (const QString &txtEntry, entry.txt()) {
|
||||
QStringList parts = txtEntry.split('=');
|
||||
if (parts.length() == 2 && parts.first() == "uuid" && parts.last() == thingId) {
|
||||
QString name = entry.name().split(" - ").first();
|
||||
QString id = entry.name().split(" - ").last();
|
||||
|
||||
if (thingId.contains(id)) {
|
||||
thing->setParamValue(bridgeThingHostParamTypeId, entry.hostAddress().toString());
|
||||
HueBridge *bridge = m_bridges.key(thing);
|
||||
bridge->setHostAddress(entry.hostAddress());
|
||||
@ -97,7 +98,6 @@ void IntegrationPluginPhilipsHue::init()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ void IntegrationPluginPhilipsHue::discoverThings(ThingDiscoveryInfo *info)
|
||||
|
||||
|
||||
qCDebug(dcPhilipsHue) << "Starting N-UPNP discovery...";
|
||||
QNetworkRequest request(QUrl(" https://discovery.meethue.com "));
|
||||
QNetworkRequest request(QUrl("https://discovery.meethue.com"));
|
||||
QNetworkReply *nUpnpReply = hardwareManager()->networkManager()->get(request);
|
||||
discovery->nUpnpReply = nUpnpReply;
|
||||
|
||||
@ -1424,9 +1424,9 @@ void IntegrationPluginPhilipsHue::processBridgeSensorDiscoveryResponse(Thing *th
|
||||
QString uuid = sensorMap.value("uniqueid").toString();
|
||||
QString model = sensorMap.value("modelid").toString();
|
||||
|
||||
// qCDebug(dcPhilipsHue()) << "Found sensor on bridge:" << model << uuid;
|
||||
// qCDebug(dcPhilipsHue()) << "Found sensor on bridge:" << model << uuid;
|
||||
foreach (HueRemote* remote, remotesToRemove) {
|
||||
// qCDebug(dcPhilipsHue()) << " - Checking remote to remove" << remote->modelId() << remote->uuid();
|
||||
// qCDebug(dcPhilipsHue()) << " - Checking remote to remove" << remote->modelId() << remote->uuid();
|
||||
if (remote->uuid() == uuid) {
|
||||
remotesToRemove.removeAll(remote);
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user