So looks like there're some typos in this function, here:
|
UnifiAPI.prototype.stat_sta_sessions_latest = function(mac = '', limit = 5, sort = '-asoc-time', site = undefined) { |
The current code looks like so:
UnifiAPI.prototype.stat_sta_sessions_latest = function(mac = '', limit = 5, sort = '-asoc-time', site = undefined) {
return this.netsite('/stat/sessions', {
mac: mac.toLowerCase(),
'_limit': limit,
'_sort': sort
}, {}, undefined, site);
};
This returns an empty dataset, for 2 reasons:
- The API to call is going to
/stat/sessions not /stat/session.
- The sorting parameter should be
-assoc_time not -asoc-time
Putting this here right now as I'm still working through other calls to try and debug if there are any issues. If I aggregate a few more I'll create a pull request to consolidate these changes.
So looks like there're some typos in this function, here:
node-unifiapi/index.js
Line 332 in 34662c5
The current code looks like so:
This returns an empty dataset, for 2 reasons:
/stat/sessionsnot/stat/session.-assoc_timenot-asoc-timePutting this here right now as I'm still working through other calls to try and debug if there are any issues. If I aggregate a few more I'll create a pull request to consolidate these changes.