Ejemplo n.º 1
0
        static async Task Main(string[] args)
        {
#if fdhghfgfhgd
            // Setup MQTT client and protocol reader
            using (var intergasReader = new IntergasReader())
            using (var mqttClient = new DomoticzMqttClient())
            using (var pusher = new IntergasMqttPublisher(mqttClient, intergasReader))
            {
                intergasReader.Start();
                mqttClient.Start();
                pusher.Start();

                // Wait until kill signal
                AutoResetEvent waitEvent = new AutoResetEvent(false);
                Console.CancelKeyPress += delegate { waitEvent.Set(); };
                waitEvent.WaitOne();
#else
            Application.EnableVisualStyles();
            Application.Run(new MainForm());
#endif
        }
    }
Ejemplo n.º 2
0
 public IntergasMqttPublisher(DomoticzMqttClient mqttClient, IntergasReader intergasReader)
 {
     _mqttClient     = mqttClient;
     _intergasReader = intergasReader;
     intergasReader.FrameReceived += OnFrameReceived;
 }