Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
Morg42 committed Feb 14, 2024
1 parent 58403c1 commit c80c4ac
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions bin/smarthome.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
arggroup.add_argument('-q', '--quiet', help='reduce logging to the logfile - DEPRECATED use logging-configuration', action='store_true')
args = argparser.parse_args()


#####################################################################
# Import Python Core Modules
#####################################################################
Expand Down Expand Up @@ -259,8 +258,6 @@ def _reload_logics():
if args.config_dir is not None:
extern_conf_dir = os.path.normpath(args.config_dir)

config_etc = args.config_etc is not None

lib.backup.make_backup_directories(BASE)

if args.restart:
Expand All @@ -287,7 +284,7 @@ def _reload_logics():
pass
atexit.register(readline.write_history_file, histfile)
readline.parse_and_bind("tab: complete")
sh = SmartHome(MODE=MODE, extern_conf_dir=extern_conf_dir, config_etc=config_etc)
sh = SmartHome(MODE=MODE, extern_conf_dir=extern_conf_dir, config_etc=args.config_etc)
_sh_thread = threading.Thread(target=sh.start)
_sh_thread.start()
shell = code.InteractiveConsole(locals())
Expand Down Expand Up @@ -316,17 +313,17 @@ def _reload_logics():
MODE = 'foreground'
pass
elif args.create_backup:
fn = lib.backup.create_backup(extern_conf_dir, BASE, config_etc=config_etc)
fn = lib.backup.create_backup(extern_conf_dir, BASE, config_etc=args.config_etc)
if fn:
print("Backup of configuration created at: \n{}".format(fn))
exit(0)
elif args.create_backup_t:
fn = lib.backup.create_backup(extern_conf_dir, BASE, filename_with_timestamp=True, config_etc=config_etc)
fn = lib.backup.create_backup(extern_conf_dir, BASE, filename_with_timestamp=True, config_etc=args.config_etc)
if fn:
print("Backup of configuration created at: \n{}".format(fn))
exit(0)
elif args.restore_backup:
fn = lib.backup.restore_backup(extern_conf_dir, BASE, config_etc=config_etc)
fn = lib.backup.restore_backup(extern_conf_dir, BASE, config_etc=args.config_etc)
if fn is not None:
print("Configuration has been restored from: \n{}".format(fn))
print("Restart SmartHomeNG to use the restored configuration")
Expand All @@ -339,6 +336,6 @@ def _reload_logics():
if MODE == 'debug':
lib.daemon.write_pidfile(psutil.Process().pid, PIDFILE)
# Starting SmartHomeNG
sh = SmartHome(MODE=MODE, extern_conf_dir=extern_conf_dir, config_etc=config_etc)
sh = SmartHome(MODE=MODE, extern_conf_dir=extern_conf_dir, config_etc=args.config_etc)
sh.start()

0 comments on commit c80c4ac

Please sign in to comment.