How to use the fritzconnection.cli.utils.get_instance function in fritzconnection

To help you get started, we’ve selected a few fritzconnection examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kbr / fritzconnection / fritzconnection / cli / fritzinspection.py View on Github external
def main():
    """CLI entry point."""
    args = get_cli_arguments(add_arguments)
    fc = get_instance(FritzConnection, args)
    inspector = FritzInspection(fc=fc)
    run_inspector(inspector, args)
github kbr / fritzconnection / fritzconnection / cli / fritzstatus.py View on Github external
def main():
    args = get_cli_arguments()
    if not args.password:
        print('Exit: password required.')
    else:
        fs = get_instance(FritzStatus, args)
        print_header(fs)
        print_status(fs)
github kbr / fritzconnection / fritzconnection / cli / fritzphonebook.py View on Github external
def main():
    args = get_cli_arguments(add_arguments)
    if not args.password:
        print('Exit: password required.')
        return
    fpb = get_instance(FritzPhonebook, args)
    print_header(fpb)
    print('FritzPhonebook:\n')
    if args.all:
        print_phonebooks(fpb)
    elif args.name:
        print_search_name(fpb, args)
    elif args.number:
        print_search_number(fpb, args)
    print()  # blank line for better readability
github kbr / fritzconnection / fritzconnection / cli / fritzhosts.py View on Github external
def main():
    args = get_cli_arguments()
    if not args.password:
        print('Exit: password required.')
    else:
        fh = get_instance(FritzHosts, args)
        print_header(fh)
        print_status(fh)
github kbr / fritzconnection / fritzconnection / cli / fritzcall.py View on Github external
def main():
    arguments = get_cli_arguments(add_arguments)
    if not arguments.password:
        print('Exit: password required.')
        return
    fc = get_instance(FritzCall, arguments)
    if arguments.call:
        dial_number(fc, arguments.call)
    else:
        print_header(fc)
        report_calls(fc, arguments)
github kbr / fritzconnection / fritzconnection / cli / fritzwlan.py View on Github external
def main():
    args = get_cli_arguments(add_arguments)
    if not args.password:
        print('Exit: password required.')
    else:
        fw = get_instance(FritzWLAN, args)
        print_header(fw)
        report_devices(fw, args)
github kbr / fritzconnection / fritzconnection / cli / fritzhomeauto.py View on Github external
def main():
    arguments = get_cli_arguments(add_arguments)
    if not arguments.password:
        print('Exit: password required.')
        return
    fh = get_instance(FritzHomeAutomation, arguments)
    if arguments.switch:
        switch_device(fh, arguments)
    else:
        print_header(fh)
        report_status(fh, arguments)