コード例 #1
0
        public StorageHandler(ILogging logging, IIniSettings iniSettings, string dbPath = null)
        {
            _logging     = logging;
            _iniSettings = iniSettings;
            var fullPathToDb = CreateDbPath();

            if (!string.IsNullOrEmpty(dbPath))
            {
                fullPathToDb = dbPath;
            }

            _pathToRepo = fullPathToDb;

            if (File.Exists(fullPathToDb))
            {
                return;
            }
            _logging.LogDebug("Creating folder for liteDb database");
            var dbDirectory = Path.GetDirectoryName(fullPathToDb);

            if (dbDirectory != null)
            {
                Directory.CreateDirectory(dbDirectory);
            }
        }
コード例 #2
0
ファイル: HSPI.cs プロジェクト: oesolberg/MelcloudClimate
        public override string InitIO(string port)
        {
            _iniSettings = new IniSettings(HS);

            //_iniSettings.IniSettingsChangedForCheckInterval += IniSettingsChangedForCheckInterval;
            _iniSettings.IniSettingsChangedForUserNamePassword += IniSettingsChangedForUserNamePassword;;

            _log = new Log(HS, _iniSettings);

            _log.Info("Starting plugin");
            _config = new ConfigHandler(HS, Callback, _iniSettings, _log);
            _config.Register();

            _deviceHandler = new DeviceHandler(HS, _log);

            _settings = new Setting(HS);
            _settings.DoIniFileTemplateIfFileMissing();

            _restHandler = new RestHandler(_log);

            StartLoginAndDataFetchingInNewThread();

            Shutdown = false;
            _log.Debug("Done init io");
            return("");
        }
コード例 #3
0
 public ConfigHandler(IHSApplication hs, IAppCallbackAPI callbackApi, IIniSettings iniSettings, ILog log)
 {
     _hs          = hs;
     _callbackApi = callbackApi;
     _iniSettings = iniSettings;
     _log         = log;
 }
コード例 #4
0
ファイル: MainPlugin.cs プロジェクト: oesolberg/DataCurveSeer
 public MainPlugin(IHSApplication hs, ILogging logging, IIniSettings iniSettings, IAppCallbackAPI callback, HsCollectionFactory collectionFactory)
 {
     _hs                = hs;
     _logging           = logging;
     _iniSettings       = iniSettings;
     _callback          = callback;
     _collectionFactory = collectionFactory;
 }
コード例 #5
0
ファイル: MainConfig.cs プロジェクト: oesolberg/DataCurveSeer
 public MainConfig(ILogging logging, IHSApplication hs, IIniSettings iniSettings, IAppCallbackAPI callback, IMainPlugin mainPlugin)
 {
     _hs          = hs;
     _logging     = logging;
     _iniSettings = iniSettings;
     _callback    = callback;
     _mainPlugin  = mainPlugin;
 }
コード例 #6
0
 public GeneralConfig(string pageName, IHSApplication hs, IAppCallbackAPI callback,
                      IIniSettings iniSettings, ILog log) : base(pageName)
 {
     _pageName    = pageName;
     _hs          = hs;
     _callback    = callback;
     _iniSettings = iniSettings;
     _log         = log;
 }
コード例 #7
0
 public GetTriggersFromHomeSeerHandler(IIniSettings iniSettings, ILogging logging, IAppCallbackAPI callback, int?delayInSeconds = null)
 {
     _iniSettings = iniSettings;
     _logging     = logging;
     _callback    = callback;
     if (delayInSeconds.HasValue)
     {
         _delayInSeconds = delayInSeconds.Value;
     }
 }
コード例 #8
0
 public ConfigGeneral(string pageName, IHSApplication hs, IIniSettings iniSettings,
                      ILogging log, IMainPlugin mainPlugin) : base(pageName)
 {
     _pageName     = pageName;
     _pageNameText = pageName.Replace("_", " ");
     _hs           = hs;
     _iniSettings  = iniSettings;
     _logging      = log;
     _mainPlugin   = mainPlugin;
 }
コード例 #9
0
        public Log(IHSApplication hs, IIniSettings iniSettings)
        {
            _hs          = hs;
            _iniSettings = iniSettings;
            _iniSettings.IniSettingsChangedForLogLevel += OnIniSettingsChangedForLogLevel;

            if (_iniSettings.LogLevel == LogLevel.DebugToFile || _iniSettings.LogLevel == LogLevel.DebugToFileAndLog)
            {
                CreateLogFile();
            }
        }
コード例 #10
0
        public Logging(IIniSettings iniSettings, IHSApplication hs)
        {
            _iniSettings = iniSettings;
            _hs          = hs;

            var logPath = Path.Combine(Utility.ExePath, "Logs");

            if (!Directory.Exists(logPath))
            {
                Directory.CreateDirectory(logPath);
            }
            var logFile = Path.Combine(logPath, Utility.PluginName + "Debug.log");

            if (_iniSettings.LogLevel == LogLevel.DebugToFile || _iniSettings.LogLevel == LogLevel.DebugToFileAndLog)
            {
                CreateLogFile();
            }
        }
コード例 #11
0
        public TriggerHandler(IHSApplication hs, IAppCallbackAPI callback, IIniSettings iniSettings,
                              ILogging logging, IHsCollectionFactory collectionFactory, IHomeSeerHandler homeSeerHandler, IStorageHandler storageHandler)
        {
            _hs                = hs;
            _callback          = callback;
            _iniSettings       = iniSettings;
            _logging           = logging;
            _collectionFactory = collectionFactory;
            _homeSeerHandler   = homeSeerHandler;
            _storageHandler    = storageHandler;
            _logging.LogDebug("Creating trigger types");
            _triggerTypes = CreateTriggerTypes();

            _logging.LogDebug("Starting thread to fetch triggers");
            GetPluginTriggersFromHomeSeerInNewThread();

            _logging.LogDebug("Done init TriggerHandler");
        }
コード例 #12
0
 public ConfigurationLoadingChecker(IFileSystem fileSystem, IIniSettings iniSettings)
 {
     _fileSystem  = fileSystem;
     _iniSettings = iniSettings;
 }
コード例 #13
0
 public void SetUp()
 {
     _iniSettings = NSubstitute.Substitute.For <IIniSettings>();
     _logging     = NSubstitute.Substitute.For <ILogging>();
     _callBack    = NSubstitute.Substitute.For <IAppCallbackAPI>();
 }
コード例 #14
0
 public void SetUp()
 {
     _logging     = NSubstitute.Substitute.For <ILogging>();
     _iniSettings = NSubstitute.Substitute.For <IIniSettings>();
 }
コード例 #15
0
 public ConfigAbout(string pageName, IHSApplication hs, IIniSettings iniSettings, ILogging log) : base(pageName)
 {
     _pageName     = pageName;
     _hs           = hs;
     _pageNameText = pageName.Replace("_", " ");
 }
コード例 #16
0
ファイル: ModuleManager.cs プロジェクト: SeymourRu/FTS
 public ModuleManager(IIniSettings settings)
 {
     _settings = settings;
 }
コード例 #17
0
ファイル: Fucker.cs プロジェクト: SeymourRu/FTS
 public F****r(IIniSettings settings, IModuleManager moduleMgr)
 {
     _settings      = settings;
     _moduleManager = moduleMgr;
 }
コード例 #18
0
 public IniConverterFactory(ITypeManager typeManager, IIniSettings iniSettings)
 {
     _typeManager = typeManager;
     _iniSettings = iniSettings;
 }
コード例 #19
0
 public EnumerableConverter(IIniConverter underlyingTypeIniConverter, IIniSettings iniSettings)
 {
     _underlyingTypeIniConverter = underlyingTypeIniConverter;
     _iniSettings = iniSettings;
 }