Main example.

def main():
    """Main example."""
    logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)

    parser = argparse.ArgumentParser(
        description='Test the SMA webconnect library.')
    parser.add_argument(
        'ip', type=str, help='IP address of the Webconnect module')
    parser.add_argument(
        'user', help='installer/user')
    parser.add_argument(
        'password', help='Installer password')

    args = parser.parse_args()

    loop = asyncio.get_event_loop()

    def _shutdown(*_):
        VAR['running'] = False
        # asyncio.ensure_future(sma.close_session(), loop=loop)

    signal.signal(signal.SIGINT, _shutdown)
    # loop.add_signal_handler(signal.SIGINT, shutdown)
    # signal.signal(signal.SIGINT, signal.SIG_DFL)
    loop.run_until_complete(main_loop(
        loop, user=args.user, password=args.password, ip=args.ip))