protected override void Execute_HomeAutomationDefinition(HomeAutomationCommandContext context) { var interpreter = context.Interpreter; var networks = context.Networks; var streamStore = context.StreamStore; var ip = context.ReadParameter("IP").Value; var appDataRepository = new AppDataRepository(streamStore); var appData = appDataRepository.Load(); if (string.IsNullOrEmpty(ip)) { interpreter.WriteEvent("Searching for Hue bridge..."); ip = FindIp(); interpreter.WriteEvent("Found " + ip); } var networkContext = new HomeAutomationNetworkContext(context.Engine, context.ThreadPool); var network = new Q42HueNetwork(networkContext, ip, appData, () => interpreter.WriteEvent("Press the link button on the Hue bridge.")); networks.Add(network); appDataRepository.Save(appData); interpreter.WriteEvent("Done."); }
public WeMoNetwork(HomeAutomationNetworkContext context) : base(context) { Address = "WeMo"; Name = Address; _devices = new List<WeMoDevice>(); Devices = _devices; }
public Q42HueNetwork(HomeAutomationNetworkContext context, string ip, IAppData appData, Action notifyPressLinkButton) : base(context) { _devices = new List<Q42HueDevice>(); Devices = _devices; _client = new LocalHueClient(ip); Connect(appData, notifyPressLinkButton); }
public PiEngineeringNetwork(HomeAutomationNetworkContext context, string address) : base(context) { _devices = new List<PiEngineeringDevice>(); base.Devices = _devices; Address = address; Name = Address; Connect(); }
public ZWaveNetwork(HomeAutomationNetworkContext context) : base(context) { ZWaveController = new global::ControlThink.ZWave.ZWaveController(); this.Devices = new ZWaveDeviceCollection(this); base.Devices = this.Devices; WorkQueue = new ParallelWorkQueue(); Connect(); }
protected override void Execute_HomeAutomationDefinition(HomeAutomationCommandContext context) { var interpreter = context.Interpreter; var networks = context.Networks; var networkContext = new HomeAutomationNetworkContext(context.Engine, context.ThreadPool); var network = new WeMoNetwork(networkContext); networks.Add(network); interpreter.WriteEvent("Done."); }
public OpenZWaveNetwork(HomeAutomationNetworkContext context, string serialPortName) : base(context) { _serialPortName = serialPortName; _devices = new List<OpenZWaveDevice>(); Devices = _devices; _notificationProcessor = new OpenZWaveNotificationProcessor(this); ConfigureOptions(); Manager = new ZWManager(); Manager.Create(); Manager.OnNotification += OnNotification; Connect(); }
public Network(HomeAutomationNetworkContext context) { Context = context; Devices = new List<Device>(); }
public Network(HomeAutomationNetworkContext context) { Context = context; Devices = new List <Device>(); }