Skip to content

Commit

Permalink
(simatec) Fix Update Intervall
Browse files Browse the repository at this point in the history
  • Loading branch information
simatec committed Jan 9, 2025
1 parent 4c8b727 commit 67831b4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ You must enter these in the configuration of the adapter.
---
<!-- ### **WORK IN PROGRESS** -->
## Changelog
### **WORK IN PROGRESS**
* (simatec) Fix Update Intervall

### 0.2.6 (2025-01-09)
* (simatec) eslint-config fix
* (simatec) Dependencies updated
Expand Down
16 changes: 15 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,21 @@ export default [
// you may disable some 'jsdoc' warnings - but using jsdoc is highly recommended
// as this improves maintainability. jsdoc warnings will not block buiuld process.
rules: {
// 'jsdoc/require-jsdoc': 'off',
'jsdoc/require-jsdoc': 'off',
'no-async-promise-executor': 'off',
'prettier/prettier': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'curly': 'off',
'jsdoc/require-returns-description': 'off',
'no-else-return': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
//'no-prototype-builtins': 'off',
//'no-case-declarations': 'off',
//'no-useless-escape': 'off',
//'jsdoc/require-param': 'off',
//'@typescript-eslint/no-require-imports': 'off',
//'jsdoc/no-types': 'off',
//'jsdoc/tag-lines': 'off',
},
},

Expand Down
15 changes: 8 additions & 7 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class RemehaHomeAdapter extends utils.Adapter {
{ id: 'data.dhw.name', name: 'DHW Name', read: true, write: false, type: 'string', role: 'value' },
{ id: 'data.dhw.gasCalorificValue', name: 'Gas Calorific Value', read: true, write: false, type: 'number', role: 'value.power', unit: 'kWh/m³' },
{ id: 'data.roomThermostat.name', name: 'Thermostat Name', read: true, write: false, type: 'string', role: 'value' },
{ id: 'data.roomThermostat.setZoneMode', name: 'Set Zone Mode', role: 'level.mode.thermostat', read: true, write: true, type: 'string', states: { 'Scheduling': `${await tools._translate('Scheduling', systemLang)}`, 'Manual': `${await tools._translate('Manual', systemLang)}`, 'FrostProtection': `${await tools._translate('FrostProtection', systemLang)}` } },
{ id: 'data.roomThermostat.setZoneMode', name: 'Set Zone Mode', role: 'level.mode.thermostat', read: true, write: true, type: 'string', states: { Scheduling: `${await tools._translate('Scheduling', systemLang)}`, Manual: `${await tools._translate('Manual', systemLang)}`, FrostProtection: `${await tools._translate('FrostProtection', systemLang)}` } },
{ id: 'data.roomThermostat.currentZoneMode', name: 'Current Zone Mode', role: 'level.mode.thermostat', read: true, write: false, type: 'string' },
{ id: 'data.dhw.waterPressureOK', name: 'Water Pressure OK', read: true, write: false, role: 'switch', type: 'boolean' },
{ id: 'data.roomThermostat.firePlaceModeActive', name: 'Fireplace Mode Active', read: true, write: true, role: 'switch', type: 'boolean' },
Expand Down Expand Up @@ -291,9 +291,9 @@ class RemehaHomeAdapter extends utils.Adapter {
this.log.debug(`Post Login Status: ${response.statusCode === 200 ? 'OK' : 'failed'}`);

} catch (error) {
this.log.error('Error during login:' + error.message);
this.log.error(`Error during login: ${error.message}`);
if (error.response) {
this.log.error('Response status:' + error.response.status);
this.log.error(`Response status: ${error.response.status}`);
}
throw error;
}
Expand Down Expand Up @@ -393,7 +393,7 @@ class RemehaHomeAdapter extends utils.Adapter {

const response = await this.got.get('https://api.bdrthermea.net/Mobile/api/homes/dashboard', {
headers: {
'Authorization': `Bearer ${this.accessToken}`,
Authorization: `Bearer ${this.accessToken}`,
'Ocp-Apim-Subscription-Key': 'df605c5470d846fc91e848b1cc653ddf',
'x-csrf-token': this.csrfToken
}
Expand Down Expand Up @@ -431,7 +431,7 @@ class RemehaHomeAdapter extends utils.Adapter {

const appliance = await this.got.get(`https://api.bdrthermea.net/Mobile/api/appliances/${data?.appliances[0].applianceId}/technicaldetails`, {
headers: {
'Authorization': `Bearer ${this.accessToken}`,
Authorization: `Bearer ${this.accessToken}`,
'Ocp-Apim-Subscription-Key': 'df605c5470d846fc91e848b1cc653ddf',
'x-csrf-token': this.csrfToken
}
Expand All @@ -457,7 +457,7 @@ class RemehaHomeAdapter extends utils.Adapter {
try {
const response = await this.got.get('https://api.bdrthermea.net/Mobile/api/homes/dashboard', {
headers: {
'Authorization': `Bearer ${token}`,
Authorization: `Bearer ${token}`,
'Ocp-Apim-Subscription-Key': 'df605c5470d846fc91e848b1cc653ddf',
'x-csrf-token': this.csrfToken
}
Expand Down Expand Up @@ -485,7 +485,7 @@ class RemehaHomeAdapter extends utils.Adapter {
this.postUpdate = false;

const headers = {
'Authorization': `Bearer ${this.accessToken}`,
Authorization: `Bearer ${this.accessToken}`,
'Ocp-Apim-Subscription-Key': 'df605c5470d846fc91e848b1cc653ddf',
'x-csrf-token': this.csrfToken
}
Expand Down Expand Up @@ -557,6 +557,7 @@ class RemehaHomeAdapter extends utils.Adapter {
}
break;
}
await this.sleep(5000);
this.postUpdate = true;
await this.updateDevices();
} catch (getError) {
Expand Down

0 comments on commit 67831b4

Please sign in to comment.