Add import parameter
This commit is contained in:
parent
9eb99f283b
commit
2a6b040193
1 changed files with 6 additions and 1 deletions
|
@ -37,6 +37,9 @@ def get_arguments() -> Dict[str, Any]:
|
||||||
"translate", help="language (de, en, fr...)", metavar="LANGUAGE"
|
"translate", help="language (de, en, fr...)", metavar="LANGUAGE"
|
||||||
)
|
)
|
||||||
translate.add_argument("--json", help="print as json", action="store_true")
|
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())
|
return vars(parser.parse_args())
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,7 +72,9 @@ async def main() -> None:
|
||||||
if language := args.get("translate"):
|
if language := args.get("translate"):
|
||||||
await translate(language, json_output=args.get("json", ""))
|
await translate(language, json_output=args.get("json", ""))
|
||||||
return
|
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:
|
for device in hon.appliances:
|
||||||
if args.get("export"):
|
if args.get("export"):
|
||||||
anonymous = args.get("anonymous", False)
|
anonymous = args.get("anonymous", False)
|
||||||
|
|
Loading…
Reference in a new issue