|
|
@ -57,16 +57,17 @@ void hlw8012SaveCalibration() { |
|
|
|
setSetting("powPowerMult", hlw8012.getPowerMultiplier()); |
|
|
|
setSetting("powCurrentMult", hlw8012.getCurrentMultiplier()); |
|
|
|
setSetting("powVoltageMult", hlw8012.getVoltageMultiplier()); |
|
|
|
saveSettings(); |
|
|
|
} |
|
|
|
|
|
|
|
void hlw8012RetrieveCalibration() { |
|
|
|
double value; |
|
|
|
value = getSetting("powPowerMult", 0).toFloat(); |
|
|
|
if (value > 0) hlw8012.setPowerMultiplier((int) value); |
|
|
|
if (value > 0) hlw8012.setPowerMultiplier(value); |
|
|
|
value = getSetting("powCurrentMult", 0).toFloat(); |
|
|
|
if (value > 0) hlw8012.setCurrentMultiplier((int) value); |
|
|
|
if (value > 0) hlw8012.setCurrentMultiplier(value); |
|
|
|
value = getSetting("powVoltageMult", 0).toFloat(); |
|
|
|
if (value > 0) hlw8012.setVoltageMultiplier((int) value); |
|
|
|
if (value > 0) hlw8012.setVoltageMultiplier(value); |
|
|
|
} |
|
|
|
|
|
|
|
void hlw8012SetExpectedActivePower(unsigned int power) { |
|
|
|