Undo initial testing descriptor read

master
Simon Stürz 2021-03-22 11:18:30 +01:00
parent 7b1b5620e1
commit 971ec9a75c
2 changed files with 9 additions and 9 deletions

View File

@ -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)

View File

@ -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()));