examples/failover.py
async def set_failover_mode(mode):
    """Example of printing the current upstream."""
    jar = aiohttp.CookieJar(unsafe=True)
    websession = aiohttp.ClientSession(cookie_jar=jar)

    try:
        modem = eternalegypt.Modem(hostname=sys.argv[1], websession=websession)
        await modem.login(password=sys.argv[2])

        await modem.set_failover_mode(mode)

        await modem.logout()
    except eternalegypt.Error:
        print("Could not login")

    await websession.close()
async def set_failover_mode(mode):
    """Example of printing the current upstream."""
    jar = aiohttp.CookieJar(unsafe=True)
    websession = aiohttp.ClientSession(cookie_jar=jar)

    try:
        modem = eternalegypt.Modem(hostname=sys.argv[1], websession=websession)
        await modem.login(password=sys.argv[2])

        await modem.set_failover_mode(mode)

        await modem.logout()
    except eternalegypt.Error:
        print("Could not login")

    await websession.close()
Example of printing the current upstream.