Browse Source

Fix reset.

alexa
Tercio Gaudencio Filho 6 years ago
parent
commit
a4e2312812
No known key found for this signature in database GPG Key ID: EDF007606002A606
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      code/espurna/sensors/PZEM004TSensor.h

+ 1
- 1
code/espurna/sensors/PZEM004TSensor.h View File

@ -116,7 +116,7 @@ class PZEM004TSensor : public BaseSensor {
// If called with value = -1, the offset will be the last energy reading
// otherwise, it will be the value provided
float resetEnergy(unsigned char dev, float value = -1) {
_energy_offsets[dev] = value != 0 ? value : _readings[dev].energy;
_energy_offsets[dev] = value != -1 ? value : _readings[dev].energy;
return _energy_offsets[dev];
}


Loading…
Cancel
Save