From 2a6b040193a1cebf421c104413e21e926138cf74 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Wed, 28 Jun 2023 19:17:17 +0200 Subject: [PATCH] Add import parameter --- pyhon/__main__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyhon/__main__.py b/pyhon/__main__.py index 713e5a1..45b028f 100755 --- a/pyhon/__main__.py +++ b/pyhon/__main__.py @@ -37,6 +37,9 @@ def get_arguments() -> Dict[str, Any]: "translate", help="language (de, en, fr...)", metavar="LANGUAGE" ) translate.add_argument("--json", help="print as json", action="store_true") + parser.add_argument( + "-i", "--import", help="import pyhon data", nargs="?", default=Path().cwd() + ) return vars(parser.parse_args()) @@ -69,7 +72,9 @@ async def main() -> None: if language := args.get("translate"): await translate(language, json_output=args.get("json", "")) return - async with Hon(*get_login_data(args)) as hon: + async with Hon( + *get_login_data(args), test_data_path=Path(args.get("import", "")) + ) as hon: for device in hon.appliances: if args.get("export"): anonymous = args.get("anonymous", False)