Skip to content

Commit

Permalink
Revert "Skip if device has multiEndpoint but endpoint name is not def…
Browse files Browse the repository at this point in the history
…ined. #1252"

This reverts commit 7d41633.
  • Loading branch information
Koenkk committed May 28, 2020
1 parent de081f5 commit 4d247fb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const getProperty = (name, msg, definition) => {
if (definition.meta && definition.meta.multiEndpoint) {
const endpointName = definition.hasOwnProperty('endpoint') ?
getKey(definition.endpoint(msg.device), msg.endpoint.ID) : msg.endpoint.ID;
return endpointName ? `${name}_${endpointName}` : null;
return `${name}_${endpointName}`;
} else {
return name;
}
Expand Down Expand Up @@ -527,7 +527,6 @@ const converters = {
convert: (model, msg, publish, options, meta) => {
if (msg.data.hasOwnProperty('currentLevel')) {
const property = getProperty('brightness', msg, model);
if (!property) return;
return {[property]: msg.data['currentLevel']};
}
},
Expand Down Expand Up @@ -604,7 +603,6 @@ const converters = {
if (msg.data.hasOwnProperty(entry.key)) {
const factor = getFactor(entry.factor);
const property = getProperty(entry.name, msg, model);
if (!property) continue;
payload[property] = precisionRound(msg.data[entry.key] * factor, 2);
}
}
Expand All @@ -617,7 +615,6 @@ const converters = {
convert: (model, msg, publish, options, meta) => {
if (msg.data.hasOwnProperty('onOff')) {
const property = getProperty('state', msg, model);
if (!property) return;
return {[property]: msg.data['onOff'] === 1 ? 'ON' : 'OFF'};
}
},
Expand Down

0 comments on commit 4d247fb

Please sign in to comment.