Update discovery and make use of mac manufacturer information
This commit is contained in:
parent
9b01f61467
commit
bae410388a
@ -65,8 +65,19 @@ void IntegrationPluginWakeOnLan::discoverThings(ThingDiscoveryInfo *info)
|
|||||||
if (myThings().filterByParam(wolThingMacParamTypeId, networkDevice.macAddress()).count() != 0)
|
if (myThings().filterByParam(wolThingMacParamTypeId, networkDevice.macAddress()).count() != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString title = networkDevice.address().toString() + " (" + networkDevice.hostName() + ")";
|
QString title;
|
||||||
ThingDescriptor descriptor(wolThingClassId, title, networkDevice.macAddress());
|
if (networkDevice.hostName().isEmpty()) {
|
||||||
|
title = networkDevice.address().toString();
|
||||||
|
} else {
|
||||||
|
title = networkDevice.address().toString() + " (" + networkDevice.hostName() + ")";
|
||||||
|
}
|
||||||
|
QString description;
|
||||||
|
if (networkDevice.macAddressManufacturer().isEmpty()) {
|
||||||
|
description = networkDevice.macAddress();
|
||||||
|
} else {
|
||||||
|
description = networkDevice.macAddress() + " (" + networkDevice.macAddressManufacturer() + ")";
|
||||||
|
}
|
||||||
|
ThingDescriptor descriptor(wolThingClassId, title, description);
|
||||||
ParamList params;
|
ParamList params;
|
||||||
params.append(Param(wolThingMacParamTypeId, networkDevice.macAddress()));
|
params.append(Param(wolThingMacParamTypeId, networkDevice.macAddress()));
|
||||||
descriptor.setParams(params);
|
descriptor.setParams(params);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user