Skip to content

Commit

Permalink
fix device reference
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Oct 16, 2023
1 parent 2bc643b commit a551db5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/extractKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ function extractArray(adapter, element, key, path, write, preferedArrayName, for
if (keyName.endsWith("Id")) {
if (arrayElement[keyName] && arrayElement[keyName].replace) {
arrayPath = arrayElement[keyName].replace(/\./g, "");
arrayPath = arrayPath.replace(/;/g, "_");
} else {
arrayPath = arrayElement[keyName];
}
Expand All @@ -233,12 +234,14 @@ function extractArray(adapter, element, key, path, write, preferedArrayName, for
if (arrayElement.id) {
if (arrayElement.id.replace) {
arrayPath = arrayElement.id.replace(/\./g, "");
arrayPath = arrayPath.replace(/;/g, "_");
} else {
arrayPath = arrayElement.id;
}
}
if (arrayElement.name) {
arrayPath = arrayElement.name.replace(/\./g, "");
arrayPath = arrayPath.replace(/;/g, "_");
}
if (arrayElement.start_date_time) {
arrayPath = arrayElement.start_date_time.replace(/\./g, "");
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class Viessmannapi extends utils.Adapter {
return role.includes("type:gateway") || role.includes("type:virtual");
})
) {
this.log.debug("ignore " + device.device.deviceType);
this.log.debug("ignore " + device.deviceType);
continue;
}
await this.requestClient({
Expand Down

0 comments on commit a551db5

Please sign in to comment.