Exemple #1
0
 private static void RunWithWriterAndSensor <TheSensor, TheWriter>()
     where TheSensor : ISensor, new()
     where TheWriter : ITemperatureWriter, new()
 {
     Log.Instance.Write("Get Started");
     CronRunner <TemperatureJob <TheSensor, TheWriter> > .Run(Config.Instance.CronJob).GetAwaiter().GetResult();
 }
Exemple #2
0
        private static void RunWithWriter <TheWriter>() where TheWriter : ITemperatureWriter, new()
        {
            switch (Config.Instance.Device)
            {
            case "SenseHat":
                CronRunner <TemperatureJob <SenseHatWrapper, TheWriter> > .Run(Config.Instance.CronJob).GetAwaiter().GetResult();

                SenseHatWrapper CreateInstanceToClearDisplay;
                break;

            case "BME280":
                CronRunner <TemperatureJob <BME280Wrapper, TheWriter> > .Run(Config.Instance.CronJob).GetAwaiter().GetResult();

                break;

            case "Mock":
                CronRunner <TemperatureJob <MockSensor, TheWriter> > .Run(Config.Instance.CronJob).GetAwaiter().GetResult();

                break;

            default:
                break;
            }
        }
Exemple #3
0
 static void Main(string[] args)
 {
     CronRunner <HelloJob> .Run("0/5 0/1 8-23 * * ?").GetAwaiter().GetResult();
 }