add filtering to tags. E.g. Hue,Namrom+Gisle will return all with either of the former AND the latter. - will do the opposite.
This commit is contained in:
@@ -99,6 +99,18 @@ func (d *Device) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *Device) HasTag(tags ...string) bool {
|
||||
for _, c := range d.Tags {
|
||||
for _, c2 := range tags {
|
||||
if c == c2 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (d *Device) HasCapability(capabilities ...DeviceCapability) bool {
|
||||
for _, c := range d.Capabilities {
|
||||
for _, c2 := range capabilities {
|
||||
|
||||
Reference in New Issue
Block a user