mirror of https://github.com/nymea/nymea.git
Add filterByDeviceClass to Devices
parent
1329fab9a6
commit
6c893b63aa
|
|
@ -287,3 +287,14 @@ Devices Devices::filterByParam(const ParamTypeId ¶mTypeId, const QVariant &v
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Devices Devices::filterByDeviceClassId(const DeviceClassId &deviceClassId)
|
||||
{
|
||||
Devices ret;
|
||||
foreach (Device* device, *this) {
|
||||
if (device->deviceClassId() == deviceClassId) {
|
||||
ret << device;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ public:
|
|||
Devices(const QList<Device *> &other);
|
||||
Device* findById(const DeviceId &id);
|
||||
Devices filterByParam(const ParamTypeId ¶mTypeId, const QVariant &value = QVariant());
|
||||
Devices filterByDeviceClassId(const DeviceClassId &deviceClassId);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue