add support for 'host' in toml vban config

fix error with VBANCMDConnectionError error dialog
This commit is contained in:
onyx-and-iris 2026-03-09 05:46:04 +00:00
parent 81a5497a32
commit 0d04a2f33e

View File

@ -357,15 +357,17 @@ class Menus(tk.Menu):
opts = {} opts = {}
opts |= self.vban_config[f'connection-{i + 1}'] opts |= self.vban_config[f'connection-{i + 1}']
kind_id = opts.pop('kind') kind_id = opts.pop('kind')
if 'ip' in opts:
opts['host'] = opts.pop('ip')
self.vban = vban_cmd.api(kind_id, **opts) self.vban = vban_cmd.api(kind_id, **opts)
# login to vban interface # login to vban interface
try: try:
self.logger.info(f'Attempting vban connection to {opts.get("ip")}') self.logger.info(f'Attempting vban connection to {opts.get("host")}')
self.vban.login() self.vban.login()
except VBANCMDConnectionError as e: except VBANCMDConnectionError as e:
self.vban.logout() self.vban.logout()
msg = ( msg = (
f'Timeout attempting to establish connection to {opts.get("ip")}', f'Timeout attempting to establish connection to {opts.get("host")}',
'Please check your connection settings', 'Please check your connection settings',
) )
messagebox.showerror('Connection Error', '\n'.join(msg)) messagebox.showerror('Connection Error', '\n'.join(msg))