FlowerCare: Drop unneeded name parameter
This commit is contained in:
parent
95a3080838
commit
7fdc9828fa
@ -74,8 +74,7 @@ DeviceManager::DeviceSetupStatus DevicePluginFlowercare::setupDevice(Device *dev
|
|||||||
|
|
||||||
if (device->deviceClassId() == flowerCareDeviceClassId) {
|
if (device->deviceClassId() == flowerCareDeviceClassId) {
|
||||||
QBluetoothAddress address = QBluetoothAddress(device->paramValue(flowerCareDeviceMacParamTypeId).toString());
|
QBluetoothAddress address = QBluetoothAddress(device->paramValue(flowerCareDeviceMacParamTypeId).toString());
|
||||||
QString name = device->paramValue(flowerCareDeviceNameParamTypeId).toString();
|
QBluetoothDeviceInfo deviceInfo = QBluetoothDeviceInfo(address, device->name(), 0);
|
||||||
QBluetoothDeviceInfo deviceInfo = QBluetoothDeviceInfo(address, name, 0);
|
|
||||||
|
|
||||||
BluetoothLowEnergyDevice *bluetoothDevice = hardwareManager()->bluetoothLowEnergyManager()->registerDevice(deviceInfo, QLowEnergyController::PublicAddress);
|
BluetoothLowEnergyDevice *bluetoothDevice = hardwareManager()->bluetoothLowEnergyManager()->registerDevice(deviceInfo, QLowEnergyController::PublicAddress);
|
||||||
FlowerCare *flowerCare = new FlowerCare(bluetoothDevice, this);
|
FlowerCare *flowerCare = new FlowerCare(bluetoothDevice, this);
|
||||||
@ -167,9 +166,8 @@ void DevicePluginFlowercare::onBluetoothDiscoveryFinished()
|
|||||||
qCDebug(dcFlowerCare()) << "Discovered device" << deviceInfo.name();
|
qCDebug(dcFlowerCare()) << "Discovered device" << deviceInfo.name();
|
||||||
if (deviceInfo.name().contains("Flower care")) {
|
if (deviceInfo.name().contains("Flower care")) {
|
||||||
if (!verifyExistingDevices(deviceInfo)) {
|
if (!verifyExistingDevices(deviceInfo)) {
|
||||||
DeviceDescriptor descriptor(flowerCareDeviceClassId, "Flower Care", deviceInfo.address().toString());
|
DeviceDescriptor descriptor(flowerCareDeviceClassId, deviceInfo.name(), deviceInfo.address().toString());
|
||||||
ParamList params;
|
ParamList params;
|
||||||
params.append(Param(flowerCareDeviceNameParamTypeId, deviceInfo.name()));
|
|
||||||
params.append(Param(flowerCareDeviceMacParamTypeId, deviceInfo.address().toString()));
|
params.append(Param(flowerCareDeviceMacParamTypeId, deviceInfo.address().toString()));
|
||||||
descriptor.setParams(params);
|
descriptor.setParams(params);
|
||||||
foreach (Device *existingDevice, myDevices()) {
|
foreach (Device *existingDevice, myDevices()) {
|
||||||
|
|||||||
@ -15,13 +15,6 @@
|
|||||||
"createMethods": ["discovery"],
|
"createMethods": ["discovery"],
|
||||||
"interfaces": ["temperaturesensor", "lightsensor", "moisturesensor", "conductivitysensor", "connectable", "batterylevel"],
|
"interfaces": ["temperaturesensor", "lightsensor", "moisturesensor", "conductivitysensor", "connectable", "batterylevel"],
|
||||||
"paramTypes": [
|
"paramTypes": [
|
||||||
{
|
|
||||||
"id": "65f95e3c-59fe-47d6-ba4a-2469e5f554e2",
|
|
||||||
"name": "name",
|
|
||||||
"displayName": "Name",
|
|
||||||
"type": "QString",
|
|
||||||
"inputType": "TextLine"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "fe2dba0f-2a47-463e-a645-bcd55cf09750",
|
"id": "fe2dba0f-2a47-463e-a645-bcd55cf09750",
|
||||||
"name": "mac",
|
"name": "mac",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user