|
|
@ -238,6 +238,7 @@ void _sensorWebSocketOnConnected(JsonObject& root) { |
|
|
|
for (unsigned char i=0; i<_sensors.size(); i++) { |
|
|
|
|
|
|
|
BaseSensor * sensor = _sensors[i]; |
|
|
|
UNUSED(sensor); |
|
|
|
|
|
|
|
#if EMON_ANALOG_SUPPORT
|
|
|
|
if (sensor->getID() == SENSOR_EMON_ANALOG_ID) { |
|
|
@ -1378,17 +1379,17 @@ void _sensorConfigure() { |
|
|
|
double value; |
|
|
|
HLW8012Sensor * sensor = (HLW8012Sensor *) _sensors[i]; |
|
|
|
|
|
|
|
if (value = getSetting("pwrExpectedC", 0).toFloat()) { |
|
|
|
if ((value = getSetting("pwrExpectedC", 0).toFloat())) { |
|
|
|
sensor->expectedCurrent(value); |
|
|
|
setSetting("pwrRatioC", sensor->getCurrentRatio()); |
|
|
|
} |
|
|
|
|
|
|
|
if (value = getSetting("pwrExpectedV", 0).toInt()) { |
|
|
|
if ((value = getSetting("pwrExpectedV", 0).toInt())) { |
|
|
|
sensor->expectedVoltage(value); |
|
|
|
setSetting("pwrRatioV", sensor->getVoltageRatio()); |
|
|
|
} |
|
|
|
|
|
|
|
if (value = getSetting("pwrExpectedP", 0).toInt()) { |
|
|
|
if ((value = getSetting("pwrExpectedP", 0).toInt())) { |
|
|
|
sensor->expectedPower(value); |
|
|
|
setSetting("pwrRatioP", sensor->getPowerRatio()); |
|
|
|
} |
|
|
|