Beispiel #1
0
        public void Initialize(AppConfig appConfig)
        {
            _appConfig = appConfig;

            var conditionCompiler = new ConditionCompiler();
            var conditions        = conditionCompiler.Compile(_appConfig.Conditions.Where(x => x.Type == ConditionType.Regular));

            _conditionFilter = new ConditionFilter(_stateStore, conditions);
        }
        private Condition compile(string conditionText)
        {
            var settings = new ConditionSettings(conditionText, PowerStatus.Undefined, ConditionType.Regular, "", new Socket(1, ""));

            var compiler = new ConditionCompiler();

            return(compiler.Compile(new List <ConditionSettings>()
            {
                settings
            }).FirstOrDefault());
        }