From 939075497133cd0e61300b4625a3435784f877e5 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 24 Jun 2019 20:42:03 +0200 Subject: [PATCH] WeMo: Fix discovery if device has been renamed --- wemo/devicepluginwemo.cpp | 5 ++--- wemo/devicepluginwemo.json | 7 ------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/wemo/devicepluginwemo.cpp b/wemo/devicepluginwemo.cpp index 3c385333..6cb59f75 100644 --- a/wemo/devicepluginwemo.cpp +++ b/wemo/devicepluginwemo.cpp @@ -246,10 +246,9 @@ void DevicePluginWemo::onUpnpDiscoveryFinished() QList deviceDescriptors; foreach (const UpnpDeviceDescriptor &upnpDeviceDescriptor, reply->deviceDescriptors()) { - if (upnpDeviceDescriptor.friendlyName() == "WeMo Switch") { - DeviceDescriptor descriptor(wemoSwitchDeviceClassId, "WeMo Switch", upnpDeviceDescriptor.serialNumber()); + if (upnpDeviceDescriptor.deviceType() == "urn:Belkin:device:controllee:1") { + DeviceDescriptor descriptor(wemoSwitchDeviceClassId, upnpDeviceDescriptor.friendlyName(), upnpDeviceDescriptor.serialNumber()); ParamList params; - params.append(Param(wemoSwitchDeviceNameParamTypeId, upnpDeviceDescriptor.friendlyName())); params.append(Param(wemoSwitchDeviceHostParamTypeId, upnpDeviceDescriptor.hostAddress().toString())); params.append(Param(wemoSwitchDevicePortParamTypeId, upnpDeviceDescriptor.port())); params.append(Param(wemoSwitchDeviceSerialParamTypeId, upnpDeviceDescriptor.serialNumber())); diff --git a/wemo/devicepluginwemo.json b/wemo/devicepluginwemo.json index dc043c25..a4c5a428 100644 --- a/wemo/devicepluginwemo.json +++ b/wemo/devicepluginwemo.json @@ -15,13 +15,6 @@ "interfaces": ["powersocket", "connectable"], "createMethods": ["discovery"], "paramTypes": [ - { - "id": "50d2236d-b73a-4d7b-ac8a-34c6566e6543", - "name": "name", - "displayName": "name", - "type": "QString", - "inputType": "TextLine" - }, { "id": "84ed399c-edb0-40da-8e2f-86eefc5790eb", "name": "host",