public void Start(Options options) { Harmonize.Options harmonizeOptions = new Harmonize.Options(new IModulePattern[] { new ModulePattern { Path = ".", Pattern = options.ModulePattern } }); Instrumentation.Start(options.Console, options.LogPath, options.TraceNames); _harmonizer = new Harmonize.Harmonizer(harmonizeOptions); _harmonizer.Start(); }
public async void Start() { List <HarmonizedModule> modules = new List <HarmonizedModule>(); List <string> modulePaths = new List <string>(); if (_options.WithHarmony) { modules.Add(new With.Harmony.Module()); } if (_options.WithOwl) { //modules.Add(new With.Owl.Intuition.Module()); modulePaths.Add("./Modules/*.dll"); } if (_options.UseAllJoyn) { modules.Add(new Harmonize.With.Alljoyn.Module()); } if (_options.UseMessaging || _options.UseRabbitMq) { modules.Add(new Harmonize.With.Messaging.Module()); } if (_options.UseRabbitMq) { modules.Add(new Harmonize.With.Messaging.Over.RabbitMq.Module()); } Harmonize.Options harmonizeOptions = new Harmonize.Options(modulePaths.Select(path => new ModulePattern { Path = path, Pattern = "Bebbs.Harmonize.With.*.dll" }).ToArray()); _harmonizer = new Harmonize.Harmonizer(harmonizeOptions); await _harmonizer.Start(); /* This code powers on the amp once harmonize has started, kept here for reference now but will be moved shortly * var device = result.Devices.Where(d => string.Equals(d.Type, "Amplifier", StringComparison.CurrentCultureIgnoreCase) && string.Equals(d.Model, "DSP-A5", StringComparison.CurrentCultureIgnoreCase)).First(); * var control = device.Controls.Where(c => string.Equals(c.Name, "Power", StringComparison.CurrentCultureIgnoreCase)).First(); * var action = control.Actions.Where(a => string.Equals(a.Name, "PowerOn", StringComparison.CurrentCultureIgnoreCase)).First(); * var command = action.Command; * * _harmonizer.SendCommand(command); */ }
public async void Start() { List<HarmonizedModule> modules = new List<HarmonizedModule>(); List<string> modulePaths = new List<string>(); if (_options.WithHarmony) { modules.Add(new With.Harmony.Module()); } if (_options.WithOwl) { //modules.Add(new With.Owl.Intuition.Module()); modulePaths.Add("./Modules/*.dll"); } if (_options.UseAllJoyn) { modules.Add(new Harmonize.With.Alljoyn.Module()); } if (_options.UseMessaging || _options.UseRabbitMq) { modules.Add(new Harmonize.With.Messaging.Module()); } if (_options.UseRabbitMq) { modules.Add(new Harmonize.With.Messaging.Over.RabbitMq.Module()); } Harmonize.Options harmonizeOptions = new Harmonize.Options(modulePaths.Select(path => new ModulePattern { Path = path, Pattern = "Bebbs.Harmonize.With.*.dll" }).ToArray()); _harmonizer = new Harmonize.Harmonizer(harmonizeOptions); await _harmonizer.Start(); /* This code powers on the amp once harmonize has started, kept here for reference now but will be moved shortly var device = result.Devices.Where(d => string.Equals(d.Type, "Amplifier", StringComparison.CurrentCultureIgnoreCase) && string.Equals(d.Model, "DSP-A5", StringComparison.CurrentCultureIgnoreCase)).First(); var control = device.Controls.Where(c => string.Equals(c.Name, "Power", StringComparison.CurrentCultureIgnoreCase)).First(); var action = control.Actions.Where(a => string.Equals(a.Name, "PowerOn", StringComparison.CurrentCultureIgnoreCase)).First(); var command = action.Command; _harmonizer.SendCommand(command); */ }