Skip to content

Commit

Permalink
Remove energy object if device is of type modbus, that is not a norma…
Browse files Browse the repository at this point in the history
…l P1 meter
  • Loading branch information
robertraaijmakers committed Feb 21, 2025
1 parent 52ec950 commit 33b6212
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/energy_meter/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ module.exports = class DeviceEnergyMeter extends Homey.Device {
.then(() => this.log(`Device is available (${deviceData.iungo_id}-${deviceData.id}).`));
}

if (refreshedData.modelId.includes('-modbus')) {
if (this.getEnergy !== null) await this.setEnergy({});
}

// Current device state
let deviceState = this.getState();
for (const [capabilityId, value] of Object.entries(refreshedData.capabilities)) {
Expand Down

0 comments on commit 33b6212

Please sign in to comment.