Skip to content

Commit

Permalink
Default multiplier/divisorvalues
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Bowman Mørch committed Oct 1, 2024
1 parent 5b21bf6 commit d740ec0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/converters/fromZigbee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,8 @@ const converters1 = {
convert: (model, msg, publish, options, meta) => {
if (utils.hasAlreadyProcessedMessage(msg, model)) return;
const payload: KeyValueAny = {};
const multiplier = msg.endpoint.getClusterAttributeValue('seMetering', 'multiplier') as number;
const divisor = msg.endpoint.getClusterAttributeValue('seMetering', 'divisor') as number;
const multiplier = (msg.endpoint.getClusterAttributeValue('seMetering', 'multiplier') ?? 1) as number;
const divisor = (msg.endpoint.getClusterAttributeValue('seMetering', 'divisor') ?? 1000) as number;
const factor = multiplier && divisor ? multiplier / divisor : null;

if (msg.data.instantaneousDemand !== undefined) {
Expand Down

0 comments on commit d740ec0

Please sign in to comment.