mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-11-25 23:16:18 +01:00
chore: improve error msg on home assistant add-on port config (#1186)
When running as a Home Assistant add-on the ports shall not be changed as this would break config.yaml that is used by Home Assistant. Prevent the change and return an error message. Extra fixes: * fix: EOS configuration initialisation by cli under EOSdash. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
@@ -464,13 +464,23 @@ class ConfigEOS(SingletonMixin, SettingsEOSDefaults):
|
||||
|
||||
# Server host
|
||||
if args.host is not None:
|
||||
set_nested(settings, "server.host", args.host)
|
||||
logger.debug(f"CLI arg: server.host set to {args.host}")
|
||||
if "dash" in sys.argv[0]:
|
||||
# Config is read from EOSdash
|
||||
set_nested(settings, "server.eosdash_host", args.host)
|
||||
logger.debug(f"CLI arg: server.eosdash_host set to {args.host}")
|
||||
else:
|
||||
set_nested(settings, "server.host", args.host)
|
||||
logger.debug(f"CLI arg: server.host set to {args.host}")
|
||||
|
||||
# Server port
|
||||
if args.port is not None:
|
||||
set_nested(settings, "server.port", args.port)
|
||||
logger.debug(f"CLI arg: server.port set to {args.port}")
|
||||
if "dash" in sys.argv[0]:
|
||||
# Config is read from EOSdash
|
||||
set_nested(settings, "server.eosdash_port", args.port)
|
||||
logger.debug(f"CLI arg: server.eosdash_port set to {args.port}")
|
||||
else:
|
||||
set_nested(settings, "server.port", args.port)
|
||||
logger.debug(f"CLI arg: server.port set to {args.port}")
|
||||
|
||||
# Server startup_eosdash
|
||||
if args.startup_eosdash is not None:
|
||||
|
||||
Reference in New Issue
Block a user