Skip to content

Commit

Permalink
added _last_results_raw to gather
Browse files Browse the repository at this point in the history
getFullStatus()/getDeviceNameMappings() functionality.
  • Loading branch information
jens-maus committed Mar 3, 2021
1 parent 79220d8 commit 4219da7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions unifi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1829,7 +1829,12 @@ class Controller {
* @return bool|array staus array upon success, false upon failure
*/
getFullStatus(cb) {
this._request('/status', {}, null, cb);
this._request('/status', {}, null, (error, result) => {
result = this._last_results_raw;
if (typeof (cb) === 'function') {
cb(error, result);
}
});
}

/**
Expand All @@ -1841,7 +1846,12 @@ class Controller {
* @return bool|array mappings array upon success, false upon failure
*/
getDeviceNameMappings(cb) {
this._request('/dl/firmware/bundles.json', {}, null, cb);
this._request('/dl/firmware/bundles.json', {}, null, (error, result) => {
result = this._last_results_raw;
if (typeof (cb) === 'function') {
cb(error, result);
}
});
}

/**
Expand Down Expand Up @@ -3079,6 +3089,7 @@ class Controller {
}

reqfunc(options, (error, response, body) => {
this._last_results_raw = body;
if (error) {
callback(error);
} else if (body && response.statusCode >= 200 && response.statusCode < 400 &&
Expand Down

0 comments on commit 4219da7

Please sign in to comment.