From 8737e23ff404d728aede4e8a11c4a228c90cd47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Sat, 26 Aug 2017 17:10:01 +0200 Subject: [PATCH] Small fixes --- code/espurna/config/hardware.h | 6 ++---- code/espurna/emon.ino | 12 +++--------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 23f25968..991c2795 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -68,7 +68,6 @@ // Info #define MANUFACTURER "TINKERMAN" #define DEVICE "ESPURNA_H" - #define HLW8012_SUPPORT 1 // Buttons #define BUTTON1_PIN 4 @@ -84,7 +83,7 @@ #define LED1_PIN_INVERSE 0 // HLW8012 - #define HLW8012_SUPPORT 1 + #define HLW8012_SUPPORT 1 #define HLW8012_SEL_PIN 2 #define HLW8012_CF1_PIN 13 #define HLW8012_CF_PIN 14 @@ -231,7 +230,6 @@ // Info #define MANUFACTURER "ITEAD_STUDIO" #define DEVICE "SONOFF_POW" - #define HLW8012_SUPPORT 1 // Buttons #define BUTTON1_PIN 0 @@ -247,7 +245,7 @@ #define LED1_PIN_INVERSE 0 // HLW8012 - #define HLW8012_SUPPORT 1 + #define HLW8012_SUPPORT 1 #define HLW8012_SEL_PIN 5 #define HLW8012_CF1_PIN 13 #define HLW8012_CF_PIN 14 diff --git a/code/espurna/emon.ino b/code/espurna/emon.ino index e2c90a28..19938272 100644 --- a/code/espurna/emon.ino +++ b/code/espurna/emon.ino @@ -84,15 +84,9 @@ void powerMonitorSetup() { // backwards compatibility String tmp; - tmp = getSetting("pwMainsVoltage", EMON_MAINS_VOLTAGE); - setSetting("emonVoltage", tmp); - delSetting("pwMainsVoltage"); - tmp = getSetting("emonMains", EMON_MAINS_VOLTAGE); - setSetting("emonVoltage", tmp); - delSetting("emonMains"); - tmp = getSetting("pwCurrentRatio", EMON_CURRENT_RATIO); - setSetting("emonRatio", tmp); - delSetting("pwCurrentRatio"); + moveSetting("pwMainsVoltage", "emonVoltage"); + moveSetting("emonMains", "emonVoltage"); + moveSetting("pwCurrentRatio", "emonRatio"); emon.initCurrent( currentCallback,