vrachieru / asuswrt-api

Asus WRT (Wireless RouTer) API wrapper.
22 stars 13 forks source link

clients.py gives outdated devices #3

Open roger- opened 4 years ago

roger- commented 4 years ago

Running on MerlinWrt.

Viewing the clients from the router shows only currently connected devices, but the script show devices that haven't been connected in months.

The JSON response from self.get('get_clientlist(appobj)... includes a wlConnectTime entry, but the values in it are too small to be valid.

Any ideas?

engineer-myoa commented 4 years ago

@roger- Yes, you all right. The api response include clients list. and each item have wlConnectTime, isOnline fields. That method that called get_online_clients is exactly mean of ONLINE CLIENTS. So I committed what is retrieving clients related. Can you check my pull request? https://github.com/vrachieru/asuswrt-api/pull/4

roger- commented 4 years ago

I didn't notice the isOnline field -- looks like your change fixed the issue, thanks!

I also request that you include the connected time to the Client class.

engineer-myoa commented 4 years ago

That request included wlConnectTime field. but it is inaccurate. I'll check more this related.

rostopira commented 4 years ago

On stock Asus firmware only force update of list worked, allows me to track devices that were online for a minute You may check out my PR and see if it works with merlin: https://github.com/vrachieru/asuswrt-api/pull/5

engineer-myoa commented 4 years ago

@rostopira Nice work.