Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnifiAPI.stat_session function not allowing single mac filtering #16

Open
shankscoder opened this issue Aug 9, 2018 · 0 comments
Open

Comments

@shankscoder
Copy link

Comparing the stat_session function (show login sessions for clients), with the PHP version of the Unifi API class, I noticed that the PHP version lets you perform a search of sessions between a data range for a specific MAC. The NodeJS version doesn't accept a MAC as a parameter.

Node implementation

* List client sessions

PHP Implementation

https://github.com/Art-of-WiFi/UniFi-API-client/blob/master/src/Client.php#L669

An example of using this function call using the netsite function in NodeJS:

const moment = require('moment');

let conf = {
    mac: "<mac address>",
    'type': 'all',
    'start': moment().subtract(7, 'days').unix(),
    'end': moment().unix()
};

r.netsite('/stat/session', conf, {}, undefined, <sitecode>)
.then((data) => {
   console.log(data.data);
}).catch(err => console.log('Error',err));

Again will be issuing a pull-request soon, but documenting this here.

@shankscoder shankscoder changed the title stat_session function not allowing single mac filtering UnifiAPI.stat_session function not allowing single mac filtering Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant