Version: 3.4 Update

This commit is contained in:
gh0stkey
2024-11-16 18:06:49 +08:00
parent 471aab5ea1
commit e556abb6f7
9 changed files with 536 additions and 328 deletions

View File

@@ -169,6 +169,10 @@ public class ConfigLoader {
return getValueFromConfig("HaEScope", Config.scopeOptions);
}
public boolean getMode() {
return getValueFromConfig("HaEModeStatus", Config.modeStatus).equals("true");
}
private String getValueFromConfig(String name, String defaultValue) {
File yamlSetting = new File(configFilePath);
if (!yamlSetting.exists() || !yamlSetting.isFile()) {
@@ -219,6 +223,10 @@ public class ConfigLoader {
setValueToConfig("HaEScope", scope);
}
public void setMode(String mode) {
setValueToConfig("HaEModeStatus", mode);
}
private void setValueToConfig(String name, String value) {
Map<String, Object> currentConfig = loadCurrentConfig();
currentConfig.put(name, value);