diff --git a/README.md b/README.md index 7859339..37f3b88 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,9 @@ Actually only following attributes are supported: ### **WORK IN PROGRESS** --> ## Changelog +### **WORK IN PROGRESS** +* (bluefox) Corrected error with `members` + ### 2.0.0 (2022-12-22) * (bluefox) Refactoring * (bluefox) Corrected some GitHub issues diff --git a/main.js b/main.js index b8f48e3..113c694 100644 --- a/main.js +++ b/main.js @@ -1735,7 +1735,7 @@ function syncRoom(room, members, cb) { type: 'enum', common: { name: room, - members: members + members }, native: {} }; @@ -1749,7 +1749,7 @@ function syncRoom(room, members, cb) { obj.common.members = obj.common.members || []; let changed = false; for (let m = 0; m < members.length; m++) { - if (!obj.common.members.inlcudes(members[m])) { + if (!obj.common.members.includes(members[m])) { changed = true; obj.common.members.push(members[m]); } @@ -2565,10 +2565,13 @@ function parseEvent(ff, eventIN, cb) { eventNOK(fn, event, channel, `object "${parts[2]}" common.write not true`, 'warn', 'unknown'); } else if (obj && obj.common.write) { let setState = event.substr(parts[0].length + device.length + parts[2].length + 3); - if (obj.common.type === 'number') + if (obj.common.type === 'number') { setState = parseFloat(setState); - if (obj.common.type === 'boolean') + } + if (obj.common.type === 'boolean') { setState = JSON.parse(setState); + } + adapter.setForeignState(parts[2], setState, false); } });