Compare commits
1 Commits
v0.14.0-re
...
420-config
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3de23184aa |
@@ -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
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user