Example #1
0
        static void Main(string[] args)
        {
            DisableConsoleQuickEdit.Go();

            Console.WriteLine("Plex-Automation-Client starting...");

            PlexAutomationBroker plexAutomation = InitializePlexListener(PlexColor);

            plexAutomation.Start();

            //IPAutomationBroker tvIpAutomation = InitializeTVIpListener(TvColor);
            //tvIpAutomation.Start();

            //IPAutomationBroker xboxIpAutomation = InitializeXboxIpListener(XboxColor);
            //xboxIpAutomation.Start();

            HueAutomationBroker hueAutomation = InitializeHueListner(HueColor);

            hueAutomation.Start();

            DenonAutomationBroker denonAutomation = InitializeDenonListener(DenonColor);

            denonAutomation.Start();

            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("Press <ENTER> to stop the Plex-Automation-Client");
            Console.ReadKey();
        }
Example #2
0
        /// <summary>
        /// If hue is turned on, then turn on the PlexListener
        /// If hue is turned off, then turn off MyStrom and PlexListener
        /// </summary>
        private static HueAutomationBroker InitializeHueListner(ConsoleColor consoleColor, List <IBroker> brokers = null)
        {
            var notifiers = new List <INotifier>
            {
                new HueNotifier(HueIp, new List <int> {
                    CinemaHueLamp
                }),
                new MyStromNotifier(MyStromIp)
            };

            var listener = new HueListenerService(HueIp, KellerHueLamp);

            brokers = brokers ?? new List <IBroker>();
            var hueAutomation = new HueAutomationBroker(listener, notifiers, brokers);

            hueAutomation.OnMessage += message => OutputMessage(message, consoleColor);

            return(hueAutomation);
        }
Example #3
0
        /// <summary>
        /// If hue is turned on, then turn on the PlexListener
        /// If hue is turned off, then turn off MyStrom and PlexListener
        /// </summary>
        private static HueAutomationBroker InitializeHueListner(ConsoleColor consoleColor, List<IBroker> brokers = null)
        {
            var notifiers = new List<INotifier>
            {
                new HueNotifier(HueIp, new List<int> {CinemaHueLamp}),
                new MyStromNotifier(MyStromIp)
            };

            var listener = new HueListenerService(HueIp, CinemaHueLamp);

            brokers = brokers ?? new List<IBroker>();
            var hueAutomation = new HueAutomationBroker(listener, notifiers, brokers);
            hueAutomation.OnMessage += message => OutputMessage(message, consoleColor);

            return hueAutomation;
        }