Skip to content

Commit

Permalink
Merge pull request #123 from athombv/fix/meter-reset
Browse files Browse the repository at this point in the history
fix(meter-reset): return after success
  • Loading branch information
RobinBol authored Nov 9, 2023
2 parents 310bfd9 + a616a87 commit 40f513f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ZwaveDevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,9 @@ class ZwaveDevice extends Homey.Device {
if (commandClassMeter && commandClassMeter.hasOwnProperty('METER_RESET')) {

Check warning on line 1061 in lib/ZwaveDevice.js

View workflow job for this annotation

GitHub Actions / Lint

Do not access Object.prototype method 'hasOwnProperty' from target object

Check warning on line 1061 in lib/ZwaveDevice.js

View workflow job for this annotation

GitHub Actions / Lint

Do not access Object.prototype method 'hasOwnProperty' from target object
const result = await commandClassMeter.METER_RESET({});
if (result !== 'TRANSMIT_COMPLETE_OK') throw result;

// Return if reset was successful
return;
}
throw new Error('missing_meter_reset_command');
}
Expand Down

0 comments on commit 40f513f

Please sign in to comment.