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;
|
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);
|
Devices(const QList<Device *> &other);
|
||||||
Device* findById(const DeviceId &id);
|
Device* findById(const DeviceId &id);
|
||||||
Devices filterByParam(const ParamTypeId ¶mTypeId, const QVariant &value = QVariant());
|
Devices filterByParam(const ParamTypeId ¶mTypeId, const QVariant &value = QVariant());
|
||||||
|
Devices filterByDeviceClassId(const DeviceClassId &deviceClassId);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue