lib.configdirs
Resolver for the directory holding the user configuration (items, logics, structs, scenes, functions…).
With config_etc (the default) these directories live below <conf>/etc, otherwise directly below
<conf>, where <conf> is the --config_dir directory or the base directory. SmartHome and
lib.backup (which also runs from the command line without a SmartHome instance) resolve the
setting and the directory through this module.
- lib.configdirs.read_config_etc(extern_conf_dir, cmdline=False)[Quellcode]
Return the effective
config_etcsetting, readingetc/smarthome.yamlbelowextern_conf_dir.- Parameter:
extern_conf_dir (
str) – configuration base directory (containsetc)cmdline (
bool) – True if--config_etcwas given on the command line
- Rückgabetyp:
bool
- lib.configdirs.resolve_config_etc(cmdline, configured=None)[Quellcode]
Return the effective
config_etcsetting.- Parameter:
cmdline (
bool) – True if--config_etcwas given on the command line; it overridesconfiguredconfigured (
object) –config_etcvalue frometc/smarthome.yaml, None if the key is absent
- Rückgabetyp:
bool
- lib.configdirs.user_conf_dir(extern_conf_dir, config_etc)[Quellcode]
Return the directory that contains the user config directories.
- Parameter:
extern_conf_dir (
str) – configuration base directory (containsetc)config_etc (
bool) – effectiveconfig_etcsetting
- Rückgabetyp:
str