Compare commits

...

1 Commits

Author SHA1 Message Date
Stefan Allius
3de23184aa fix the paths to copy the config.example.toml file 2025-05-22 21:25:03 +02:00
3 changed files with 11 additions and 7 deletions

View File

@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [unreleased] ## [unreleased]
- fix the paths to copy the config.example.toml file during proxy start
- add MQTT topic `dcu_power` for setting output power on DCUs - add MQTT topic `dcu_power` for setting output power on DCUs
- Update ghcr.io/hassio-addons/base Docker tag to v17.2.5 - Update ghcr.io/hassio-addons/base Docker tag to v17.2.5
- fix a lot of pytest-asyncio problems in the unit tests - fix a lot of pytest-asyncio problems in the unit tests

View File

@@ -162,7 +162,8 @@ class Config():
) )
@classmethod @classmethod
def init(cls, def_reader: ConfigIfc, log_path: str = '') -> None | str: def init(cls, def_reader: ConfigIfc, log_path: str = '',
cnf_path: str = 'config') -> None | str:
'''Initialise the Proxy-Config '''Initialise the Proxy-Config
Copy the internal default config file into the config directory Copy the internal default config file into the config directory
@@ -173,12 +174,13 @@ and initialise the Config with the default configuration '''
try: try:
# make the default config transparaent by copying it # make the default config transparaent by copying it
# in the config.example file # in the config.example file
logging.debug('Copy Default Config to config.example.toml') logging.info(
f'Copy Default Config to {cnf_path}config.example.toml')
shutil.copy2("default_config.toml", shutil.copy2("cnf/default_config.toml",
"config/config.example.toml") cnf_path + "config.example.toml")
except Exception: except Exception as e:
pass logging.error(e)
# read example config file as default configuration # read example config file as default configuration
try: try:

View File

@@ -127,7 +127,8 @@ class Server():
def build_config(self): def build_config(self):
# read config file # read config file
Config.init(ConfigReadToml(self.src_dir + "cnf/default_config.toml"), Config.init(ConfigReadToml(self.src_dir + "cnf/default_config.toml"),
log_path=self.log_path) log_path=self.log_path,
cnf_path=self.config_path)
ConfigReadEnv() ConfigReadEnv()
ConfigReadJson(self.config_path + "config.json") ConfigReadJson(self.config_path + "config.json")
ConfigReadToml(self.config_path + "config.toml") ConfigReadToml(self.config_path + "config.toml")