FlowerCare: Drop unneeded name parameter
parent
95a3080838
commit
7fdc9828fa
|
|
@ -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()) {
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue