From ba112b379bac4bfbb120f3e3d3796f195a026098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Tue, 25 Apr 2017 12:59:28 +0200 Subject: [PATCH 1/2] Fix bug in getCurrent method, thanks Emmanuel Tatto --- code/espurna/pow.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/espurna/pow.ino b/code/espurna/pow.ino index bf11624b..488fb350 100644 --- a/code/espurna/pow.ino +++ b/code/espurna/pow.ino @@ -114,7 +114,7 @@ unsigned int getReactivePower() { double getCurrent() { double current = hlw8012.getCurrent(); - if (POW_MIN_CURRENT > current || current > POW_MAX_CURRENT) power = 0; + if (POW_MIN_CURRENT > current || current > POW_MAX_CURRENT) current = 0; return current; } From 134647724a873109a24d552419b69e37105e95ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Tue, 25 Apr 2017 13:20:07 +0200 Subject: [PATCH 2/2] Bind button actions to buttons 0 and 1 in DUAL (#127) --- code/espurna/button.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/espurna/button.ino b/code/espurna/button.ino index 5acaacbb..b11aa986 100644 --- a/code/espurna/button.ino +++ b/code/espurna/button.ino @@ -108,8 +108,8 @@ void buttonSetup() { #ifdef SONOFF_DUAL unsigned int actions = buttonStore(BUTTON_MODE_NONE, BUTTON_MODE_TOGGLE, BUTTON_MODE_NONE, BUTTON_MODE_NONE, BUTTON_MODE_NONE); - _buttons.push_back({new DebounceEvent(0, BUTTON_PUSHBUTTON), 0, 1}); - _buttons.push_back({new DebounceEvent(0, BUTTON_PUSHBUTTON), 0, 2}); + _buttons.push_back({new DebounceEvent(0, BUTTON_PUSHBUTTON), actions, 1}); + _buttons.push_back({new DebounceEvent(0, BUTTON_PUSHBUTTON), actions, 2}); _buttons.push_back({new DebounceEvent(0, BUTTON_PUSHBUTTON), actions, BUTTON3_RELAY}); #else @@ -176,7 +176,7 @@ void buttonLoop() { bool status = (value & (1 << i)) > 0; - // Cjeck if the status for that relay has changed + // Check if the status for that relay has changed if (relayStatus(i) != status) { buttonEvent(i, BUTTON_EVENT_CLICK); break;