Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed May 25, 2024
1 parent c5f3608 commit 28e20bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions api/hmCloudAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class HmCloudAPI {

// =========== API for Token generation ===========

async auth1connectionRequest(devicename = 'hmipnodejs') {
async auth1connectionRequest(deviceName = 'hmipnodejs') {
const headers = {
'content-type': 'application/json',
accept: 'application/json',
Expand All @@ -94,7 +94,7 @@ class HmCloudAPI {
}
const body = {
deviceId: this._deviceId,
deviceName: devicename,
deviceName,
sgtin: this._accessPointSgtin,
};
try {
Expand All @@ -118,11 +118,11 @@ class HmCloudAPI {
};
const body = { deviceId: this._deviceId };
try {
const response = await axios.post(`${this._urlREST}/hmip/auth/isRequestAcknowledged`, body, {
await axios.post(`${this._urlREST}/hmip/auth/isRequestAcknowledged`, body, {
headers,
validateStatus: status => status < 400,
validateStatus: status => status === 200,
});
return response.data && typeof response.data === 'object';
return true;
} catch (err) {
this.requestError && this.requestError(err);
return false;
Expand Down
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,9 @@ class HmIpCloudAccesspointAdapter extends utils.Adapter {
}

async _stateChange(id, state) {
if (!id || !state || state.ack || this._unloaded) return;
if (!id || !state || state.ack || this._unloaded) {
return;
}

let o = await this.getObjectAsync(id);
if (o && o.native && o.native.parameter) {
Expand Down

0 comments on commit 28e20bf

Please sign in to comment.