private void LoadControllerSettings() { Settings = new SettingsContainer(StoragePath.WithFilename("Settings.json")); Settings.SetValue("Name", "HA4IoT Controller"); Settings.SetValue("Description", "The HA4IoT controller which is responsible for this house."); Settings.Load(); }
public AreaSettingsWrapper(ISettingsContainer settings) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } Settings = settings; Settings.SetValue("appSettings", new JsonObject()); }
public ComponentSettingsWrapper(ISettingsContainer settings) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } Settings = settings; IsEnabled = true; Settings.SetValue("appSettings", new JsonObject()); }
private static void TextToSettings(string text, ISettingsContainer settings) { using (StringReader reader = new StringReader(text)) { string line; while ((line = reader.ReadLine()) != null) { var pair = line.Split(new char[] { '=' }, 2); if (pair.Length == 2) { settings.SetValue(pair[0], pair[1]); } } } }