diff --git a/!START.bat b/!START.bat index 7411a91..1f65bd4 100644 --- a/!START.bat +++ b/!START.bat @@ -1,3 +1,3 @@ -@echo off -chcp 866 >NUL -start cmd /k python\python.exe menu.py +@echo off +chcp 866 >NUL +start cmd /k python\python.exe menu.py diff --git a/read_info.py b/read_info.py index 0544641..9bcb6dc 100644 --- a/read_info.py +++ b/read_info.py @@ -739,6 +739,13 @@ class SysLog(): if __name__ == "__main__": + if len(sys.argv) > 1 and sys.argv[1] == 'syslog': + gw = gateway.Gateway(timeout = 4) + if gw.status < 1: + die("Xiaomi Mi Wi-Fi device not found (IP: {})".format(gw.ip_addr)) + slog = SysLog(gw, timeout = 10, verbose = 1, infolevel = 2) + sys.exit(0) + fn_dir = '' fn_old = 'full_info_old.txt' fn_local = 'full_info.txt' diff --git a/run.bat b/run.bat index 46affcb..e416d11 100644 --- a/run.bat +++ b/run.bat @@ -1,3 +1,11 @@ -@echo off -chcp 866 >NUL -python\python.exe menu.py +@echo off +chcp 866 >NUL + +if "%~1"=="" goto menu + +python\python.exe %* +goto :EOF + +:menu +python\python.exe menu.py +goto :EOF