mirror of https://github.com/nymea/nymea.git
Merge PR #171: Add filterByDeviceClass to Devices
commit
d2c87a619c
|
|
@ -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