Skip to content

Commit

Permalink
* (bluefox) Corrected error with members
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Dec 23, 2022
1 parent b6246ce commit 3dfd008
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ function syncRoom(room, members, cb) {
type: 'enum',
common: {
name: room,
members: members
members
},
native: {}
};
Expand All @@ -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]);
}
Expand Down Expand Up @@ -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);
}
});
Expand Down

0 comments on commit 3dfd008

Please sign in to comment.