Exemplo n.º 1
0
        public async void Start(bool isDocker = false)
        {
            Log.Information("Starting logic");
            try
            {
                if (isDocker)
                {
                    Configuration.Instance.FromEnvironment();
                }
                else
                {
                    Configuration.Instance.FromYaml(
                        Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "config.yml"));
                }

                Log.Debug("Used configuration:");
                Log.Debug(Configuration.Instance.ToYaml());

                _logic = new NukiBridge2MqttLogic();
                await _logic.Start();
            }
            catch (Exception e)
            {
                Log.Fatal(e.Message, e);
            }
        }
Exemplo n.º 2
0
        protected override async void OnStart(string[] args)
        {
            Log.Information("Starting service");

            try
            {
                Configuration.Instance.FromYaml(
                    Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "config.yml"));

                _logic = new NukiBridge2MqttLogic();
                await _logic.Start();
            }
            catch (Exception e)
            {
                Log.Fatal(e.Message, e);
            }
        }