From 08311a0c0ced2a39c20bc5a6ab0dc182ead81700 Mon Sep 17 00:00:00 2001 From: TA2k Date: Thu, 24 Oct 2024 09:54:11 +0200 Subject: [PATCH] stringify api value --- main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 1cdfc7e..d057189 100644 --- a/main.js +++ b/main.js @@ -665,7 +665,7 @@ class Homeconnect extends utils.Adapter { ) { common.max = subElement.constraints.max; } - this.extendObjectAsync(haId + folder + '.' + subElement.key.replace(/\./g, '_'), { + this.extendObject(haId + folder + '.' + subElement.key.replace(/\./g, '_'), { type: 'state', common: common, native: {}, @@ -673,13 +673,13 @@ class Homeconnect extends utils.Adapter { .then(() => { if (subElement.value !== undefined) { this.log.debug('Set api value'); - this.setStateAsync( + this.setState( haId + folder + '.' + subElement.key.replace(/\./g, '_'), - subElement.value, + JSON.stringify(subElement.value), true, ).catch((error) => { this.log.error('failed set state ' + haId + folder + '.' + subElement.key.replace(/\./g, '_')); - this.log.error("Value: '" + subElement.value + "'"); + this.log.error("Value: '" + JSON.stringify(subElement.value) + "'"); this.log.error(error); }); }