Skip to content

Commit

Permalink
stringify api value
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Oct 24, 2024
1 parent 777887f commit 08311a0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,21 +665,21 @@ 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: {},
})
.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);
});
}
Expand Down

0 comments on commit 08311a0

Please sign in to comment.