コード例 #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();
        }
コード例 #2
0
        /// <summary>
        /// If denon input is game or cable turn off lights
        /// If plex input is anything else or device is turned of turn on lights
        /// </summary>
        private static DenonAutomationBroker InitializeDenonListener(ConsoleColor consoleColor)
        {
            var notifiers = new List <INotifier>
            {
                new HueNotifier(HueIp, new List <int> {
                    CinemaHueLamp
                }),
                new MyStromNotifier(MyStromIp)
            };

            var listener = new DenonListenerService(DenonIp);

            var denonAutomation = new DenonAutomationBroker(listener, notifiers);

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

            return(denonAutomation);
        }