public static IOpenZWaveDeviceValueMatcher Create(byte id, CommandClass commandClass, byte?index, byte?instance = null) { var matchers = new List <IOpenZWaveDeviceValueMatcher> { new IdMatcher(id), new CommandClassMatcher(commandClass) }; if (index != null) { matchers.Add(new IndexMatcher(index.Value)); } if (instance != null) { matchers.Add(new InstanceMatcher(instance.Value)); } var result = new CompositeMatcher(matchers.ToArray()); return(result); }
public static IOpenZWaveDeviceValueMatcher Create(byte id, CommandClass commandClass, byte? index, byte? instance = null) { var matchers = new List<IOpenZWaveDeviceValueMatcher> { new IdMatcher(id), new CommandClassMatcher(commandClass) }; if (index != null) { matchers.Add(new IndexMatcher(index.Value)); } if (instance != null) { matchers.Add(new InstanceMatcher(instance.Value)); } var result = new CompositeMatcher(matchers.ToArray()); return result; }