FlowerCare: Drop unneeded name parameter

master
Michael Zanetti 2019-06-17 13:28:03 +02:00
parent 95a3080838
commit 7fdc9828fa
2 changed files with 2 additions and 11 deletions

View File

@ -74,8 +74,7 @@ DeviceManager::DeviceSetupStatus DevicePluginFlowercare::setupDevice(Device *dev
if (device->deviceClassId() == flowerCareDeviceClassId) {
QBluetoothAddress address = QBluetoothAddress(device->paramValue(flowerCareDeviceMacParamTypeId).toString());
QString name = device->paramValue(flowerCareDeviceNameParamTypeId).toString();
QBluetoothDeviceInfo deviceInfo = QBluetoothDeviceInfo(address, name, 0);
QBluetoothDeviceInfo deviceInfo = QBluetoothDeviceInfo(address, device->name(), 0);
BluetoothLowEnergyDevice *bluetoothDevice = hardwareManager()->bluetoothLowEnergyManager()->registerDevice(deviceInfo, QLowEnergyController::PublicAddress);
FlowerCare *flowerCare = new FlowerCare(bluetoothDevice, this);
@ -167,9 +166,8 @@ void DevicePluginFlowercare::onBluetoothDiscoveryFinished()
qCDebug(dcFlowerCare()) << "Discovered device" << deviceInfo.name();
if (deviceInfo.name().contains("Flower care")) {
if (!verifyExistingDevices(deviceInfo)) {
DeviceDescriptor descriptor(flowerCareDeviceClassId, "Flower Care", deviceInfo.address().toString());
DeviceDescriptor descriptor(flowerCareDeviceClassId, deviceInfo.name(), deviceInfo.address().toString());
ParamList params;
params.append(Param(flowerCareDeviceNameParamTypeId, deviceInfo.name()));
params.append(Param(flowerCareDeviceMacParamTypeId, deviceInfo.address().toString()));
descriptor.setParams(params);
foreach (Device *existingDevice, myDevices()) {

View File

@ -15,13 +15,6 @@
"createMethods": ["discovery"],
"interfaces": ["temperaturesensor", "lightsensor", "moisturesensor", "conductivitysensor", "connectable", "batterylevel"],
"paramTypes": [
{
"id": "65f95e3c-59fe-47d6-ba4a-2469e5f554e2",
"name": "name",
"displayName": "Name",
"type": "QString",
"inputType": "TextLine"
},
{
"id": "fe2dba0f-2a47-463e-a645-bcd55cf09750",
"name": "mac",