Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
apexad committed Nov 22, 2020
1 parent ad53a22 commit cd79242
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ export class MySmartBlindsBridgePlatform implements DynamicPlatformPlugin {
method: 'POST',
uri: MYSMARTBLINDS_GRAPHQL,
json: true,
headers: {
Authorization: `Bearer ${this.auth0Token}`,
},
headers: { Authorization: `Bearer ${this.auth0Token}` },
};

this.auth0TokenExpireDate = new Date(
Expand Down Expand Up @@ -144,7 +142,7 @@ export class MySmartBlindsBridgePlatform implements DynamicPlatformPlugin {
discoverDevices() {
this.refreshAuthToken().then(() => {
this.auth0TokenInterval = setInterval(this.refreshAuthToken.bind(this), 1000 * 60 * 60 * 8);
rp(Object.assign(this.requestOptions, { body: { query: MYSMARTBLINDS_QUERIES.GetUserInfo, variables: null } }))
rp(Object.assign({}, this.requestOptions, { body: { query: MYSMARTBLINDS_QUERIES.GetUserInfo, variables: null } }))
.then((response) => {
if (this.config.allowDebug) {
this.log.debug('GetUserInfo', response.data.user);
Expand Down Expand Up @@ -173,6 +171,7 @@ export class MySmartBlindsBridgePlatform implements DynamicPlatformPlugin {
// create a new accessory
const accessory = new this.api.platformAccessory(blindName, uuid);
rp(Object.assign(
{},
this.requestOptions,
{ body: { query: MYSMARTBLINDS_QUERIES.GetBlindSate, variables: { blinds: blind.encodedMacAddress } } },
)).then((response) => {
Expand Down

0 comments on commit cd79242

Please sign in to comment.