Skip to content

Commit

Permalink
Fixed bug in parsing response
Browse files Browse the repository at this point in the history
  • Loading branch information
DEV2DEV-DE committed Nov 26, 2023
1 parent d231a5d commit a736098
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Jablotron extends utils.Adapter {

async parseResponse(data) {
if (data) {
const serviceDetail = data['service-detail'];
const serviceDetail = data['data']['service-data']['service-detail'];
for (const key in serviceDetail) {
console.log(`Key: ${key}, Value: ${serviceDetail[key]}`);
await this.setObjectNotExistsAsync(`service.${key}`, { type: 'state', common: { name: `${key}`, type: 'string', role: 'state', read: true, write: false}, native: {},});
Expand Down Expand Up @@ -146,7 +146,7 @@ class Jablotron extends utils.Adapter {
}

async createObjectStructure() {
await this.setObjectNotExistsAsync('status.alarm', { type: 'state', common: { name: 'Alarm status', type: 'number', role: 'level', read: true, write: true, states: '0:disarm;1:home;2:arm;3:alarm', min: 0, max: 3 }, native: {},});
await this.setObjectNotExistsAsync('info.connection', { type: 'state', common: { name: 'Communication with service working', type: 'boolean', role: 'indicator.connected', read: true, write: false}, native: {},});
}

}
Expand Down

0 comments on commit a736098

Please sign in to comment.