diff --git a/nuki/bluez/bluetoothgattdescriptor.cpp b/nuki/bluez/bluetoothgattdescriptor.cpp index 35531c9a..c50c1410 100644 --- a/nuki/bluez/bluetoothgattdescriptor.cpp +++ b/nuki/bluez/bluetoothgattdescriptor.cpp @@ -76,13 +76,11 @@ BluetoothGattDescriptor::BluetoothGattDescriptor(const QDBusObjectPath &path, co processProperties(properties); - readValue(); - -// QDBusPendingCall readingCall = m_descriptorInterface->asyncCall("GetAll", QVariantMap()); -// QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(readingCall, this); -// connect(watcher, &QDBusPendingCallWatcher::finished, this, [=](){ -// qCDebug(dcBluez()) << "Get descriptor properties finished"; -// }); + QDBusPendingCall readingCall = m_descriptorInterface->asyncCall("GetAll", QVariantMap()); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(readingCall, this); + connect(watcher, &QDBusPendingCallWatcher::finished, this, [=](){ + qCDebug(dcBluez()) << "Get descriptor properties finished"; + }); } void BluetoothGattDescriptor::processProperties(const QVariantMap &properties) diff --git a/nuki/integrationpluginnuki.cpp b/nuki/integrationpluginnuki.cpp index cf0ff92f..915283b7 100644 --- a/nuki/integrationpluginnuki.cpp +++ b/nuki/integrationpluginnuki.cpp @@ -308,8 +308,9 @@ void IntegrationPluginNuki::onBluetoothDiscoveryFinished(ThingDiscoveryInfo *inf m_bluetoothAdapter->stopDiscovering(); foreach (BluetoothDevice *thing, m_bluetoothAdapter->devices()) { - if (!bluetoothDeviceAlreadyAdded(thing->address()) && thing->name().contains("Nuki")) { - ThingDescriptor descriptor(nukiThingClassId, "Nuki", thing->address().toString()); + qCDebug(dcNuki()) << "Found bluetooth device" << thing->name() << thing->address().toString(); + if (!bluetoothDeviceAlreadyAdded(thing->address()) && thing->name().toLower().contains("nuki")) { + qCDebug(dcNuki()) << "Found nuki smart lock which has not been added yet"; // Get serial number from name QString serialNumber; @@ -320,6 +321,7 @@ void IntegrationPluginNuki::onBluetoothDiscoveryFinished(ThingDiscoveryInfo *inf qCWarning(dcNuki()) << "Could not read serial number from bluetooth thing name" << thing->name(); } + ThingDescriptor descriptor(nukiThingClassId, "Nuki", thing->address().toString()); ParamList params; params.append(Param(nukiThingNameParamTypeId, thing->name())); params.append(Param(nukiThingMacParamTypeId, thing->address().toString()));