Skip to content

Instantly share code, notes, and snippets.

@chrisboyle
Created October 10, 2024 15:18
Show Gist options
  • Save chrisboyle/c2c14b13f5da47fa58972a122d7b6669 to your computer and use it in GitHub Desktop.
Save chrisboyle/c2c14b13f5da47fa58972a122d7b6669 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import asyncio
from pyvelop.mesh import Mesh
async def setEnabled(mesh, enabled):
await mesh._async_make_request(action="http://linksys.com/jnap/routerupnp/SetUPnPSettings", payload={"isUPnPEnabled": enabled,"canUsersConfigure": False, "canUsersDisableWANAccess": False})
async def main():
async with Mesh(node="192.168.1.1", password="INSERT_PASSWORD_HERE") as mesh:
#await mesh.async_gather_details()
#print(mesh.nodes)
await setEnabled(mesh, False)
await setEnabled(mesh, True)
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment