Browse Source

Fix energy ratio input for pulse meter sensor (#1394)

* Fix energy ratio input for pulse meter sensor

* checkout origin/dev -- webui files
alexa
Jack Wilsdon 6 years ago
committed by Max Prokhorov
parent
commit
665a473d9c
3 changed files with 5 additions and 3 deletions
  1. +3
    -0
      code/espurna/sensor.ino
  2. +1
    -1
      code/espurna/sensors/PulseMeterSensor.h
  3. +1
    -2
      code/html/index.html

+ 3
- 0
code/espurna/sensor.ino View File

@ -204,6 +204,7 @@ void _sensorWebSocketStart(JsonObject& root) {
#if PULSEMETER_SUPPORT
if (sensor->getID() == SENSOR_PULSEMETER_ID) {
root["pmVisible"] = 1;
root["pwrRatioE"] = ((PulseMeterSensor *) sensor)->getEnergyRatio();
}
#endif
@ -1091,6 +1092,8 @@ void _sensorConfigure() {
delSetting("eneTotal");
_sensorResetTS();
}
sensor->setEnergyRatio(getSetting("pwrRatioE", PULSEMETER_ENERGY_RATIO).toInt());
}
#endif // PULSEMETER_SUPPORT


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

@ -53,7 +53,7 @@ class PulseMeterSensor : public BaseSensor {
return _gpio;
}
unsigned char getEnergyRatio() {
unsigned long getEnergyRatio() {
return _ratio;
}


+ 1
- 2
code/html/index.html View File

@ -1341,8 +1341,7 @@
<div class="pure-g module module-pm">
<label class="pure-u-1 pure-u-lg-1-4">Energy Ratio</label>
<div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="pwrRatioE" tabindex="55" /></div>
<div class="pure-u-0 pure-u-lg-1-2"></div>
<input class="pure-u-1 pure-u-lg-3-4" name="pwrRatioE" type="text" tabindex="55" placeholder="0" />
<div class="pure-u-0 pure-u-lg-1-4"></div>
<div class="pure-u-1 pure-u-lg-3-4 hint">Energy ratio in pulses/kWh.</div>
</div>


Loading…
Cancel
Save