Replies: 1 comment
-
Hello, I the current implementation of the library, you can do the following: Code"""Small test for available data from your AsusRouter"""
import asyncio
from asusrouter import AsusRouter
async def gather_data(host, username, password, use_ssl):
"""Method to gether the known data"""
# Initialize
router = AsusRouter(
host=host, username=username, password=password, use_ssl=use_ssl
)
# Connect
await router.connection.async_connect()
# Get the client list
clients = await router.async_get_connected_devices()
print(clients)
# Disconnect
await router.connection.async_disconnect()
loop = asyncio.get_event_loop()
# Please, put your values in here
_host = "IP_or_hostname_here"
_username = "admin"
_password = "password"
_use_ssl = True
loop.run_until_complete(gather_data(_host, _username, _password, _use_ssl))
loop.close() As you can see, you can create an An example output will be like this: {
"AA:BB:CC:00:11:22": ConnectedDevice(
name="Name 1",
mac=AA:BB:CC:00:11:22,
ip="",
ip_method="Manual",
internet_state=True,
internet_mode="allow",
connection_type=1,
node=--AiMesh node MAC--,
online=True,
rssi=-31,
connected_since=datetime.datetime(
2023, 10, 25, 4, 33, 38, tzinfo=datetime.timezone.utc
),
rx_speed=6.0,
tx_speed=65.0,
guest=0
)
} A dictionary of If something does not work for you, please let me know - I will try to help P.S. There is a new version of AsusRouter to be released soon and it will be accompanied by a full documentation of how to use 😄 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am new to python, can you please teach me how to us your library?
I would like to get the client list of asus router
Beta Was this translation helpful? Give feedback.
All reactions