Basic command line script for testing library.

def main(argv):
    """
    Basic command line script for testing library.
    """

    # Parse command line arguments
    parser = argparse.ArgumentParser(
        description="LifeSOSpy v{} - {}".format(
            PROJECT_VERSION, PROJECT_DESCRIPTION))
    parser.add_argument(
        '-H', '--host',
        help="Hostname/IP Address for the LifeSOS server, if we are to run as a client.",
        default=None)
    parser.add_argument(
        '-P', '--port',
        help="TCP port for the LifeSOS ethernet interface.",
        default=str(BaseUnit.TCP_PORT))
    parser.add_argument(
        '-p', '--password',
        help="Password for the Master user, if remote access requires it.",
        default='')
    parser.add_argument(
        '-v', '--verbose',
        help="Display all logging output.",
        action='store_true')
    args = parser.parse_args()

    # Configure logger
    logging.basicConfig(
        format="%(asctime)s %(levelname)-5s (%(threadName)s) [%(name)s] %(message)s",
        datefmt='%Y-%m-%d %H:%M:%S',
        level=logging.DEBUG if args.verbose else logging.INFO)

    # Create base unit instance and start up interface
    print("LifeSOSpy v{} - {}\n".format(PROJECT_VERSION, PROJECT_DESCRIPTION))
    loop = asyncio.get_event_loop()
    baseunit = BaseUnit(args.host, args.port)
    if args.password:
        baseunit.password = args.password
    baseunit.start()

    # Provide interactive prompt for running test commands on another thread
    loop.run_until_complete(
        loop.run_in_executor(
            None, _handle_interactive_baseunit_tests, baseunit, loop))

    # Shut down interface and event loop
    baseunit.stop()
    loop.close()