/// <summary> /// Initialized the HomeControlService with or without a previously loaded Configuration instance /// </summary> /// <returns></returns> /// <param name="config">Configuration instance</param> public async Task InitAsync(Configuration config = null) { // Load config from SettingsService, if none has been provided if (config == null) { if (!_SettingsService.IsLoaded) await _SettingsService.LoadSettingsAsync(); config = _SettingsService.Settings.Configuration; } // Load central units if (config.CentralUnits != null) { // HomeMatic var homeMaticCentral = config.CentralUnits.FirstOrDefault(c => c.Brand == Base.Models.CentralUnitBrand.HomeMatic); if (homeMaticCentral != null && homeMaticCentral is Ccu) HomeMatic = new HomeMaticXmlApi(homeMaticCentral as Ccu); } }
public Settings() { Configuration = new Configuration(); }