From a73609898b41b45a5f5928ebbc7c8ec2602758c7 Mon Sep 17 00:00:00 2001 From: DEV2DEV-DE Date: Sun, 26 Nov 2023 22:20:53 +0100 Subject: [PATCH] Fixed bug in parsing response --- main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index aa83323..610ba6f 100644 --- a/main.js +++ b/main.js @@ -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: {},}); @@ -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: {},}); } }