Skip to content

Commit

Permalink
add header
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucky-ESA committed Sep 6, 2024
1 parent b765305 commit 3ac283e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/air_conditioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ module.exports = {
"x-thinq-app-module": "CEM",
"Accept-Language": "de-DE,de;q=0.9",
"x-emp-token": this.session.access_token,
"Accept": "application/json, text/plain, */*",
"Accept": "application/json",
"x-api-key": API_KEY,
"x-country-code": this.defaultHeaders["x-country-code"],
"x-home-id": this.homes[0].homeId,
Expand All @@ -970,7 +970,7 @@ module.exports = {
)
.then((res) => res.data)
.catch((error) => {
this.log.debug("energy_state: " + error);
this.log.debug("energy_state error: " + error);
return false;
});
this.log.info("energy_state: " + JSON.stringify(energy_state));
Expand All @@ -981,7 +981,7 @@ module.exports = {
})
.then((res) => res.data)
.catch((error) => {
this.log.debug("energy_summary: " + error);
this.log.debug("energy_summary error: " + error);
return false;
});
this.log.info("energy_summary: " + JSON.stringify(energy_summary));
Expand Down
5 changes: 4 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class LgThinq extends utils.Adapter {
this.createCourse = helper.createCourse;
this.refreshRemote = helper.refreshRemote;
this.refrigerator = helper.refrigerator;
this.getSummary = air.getSummary;
this.createAirRemoteStates = air.createAirRemoteStates;
this.createAirRemoteThinq1States = air.createAirRemoteThinq1States;
this.sendCommandThinq1AC = air.sendCommandThinq1AC;
Expand Down Expand Up @@ -971,7 +972,9 @@ class LgThinq extends utils.Adapter {

async ownRequestThinq1(data, deviceId) {
this.log.info("ownRequestThinq1: " + data);
const header = this.defaultHeaders;
const header = JSON.parse(JSON.stringify(this.defaultHeaders));
header["x-client-id"] = this.mqtt_userID != null ? this.mqtt_userID : constants.API1_CLIENT_ID;
header["x-message-id"] = this.random_string(22);
let reqData = null;
try {
reqData = JSON.parse(data);
Expand Down

0 comments on commit 3ac283e

Please sign in to comment.