From 6c69b8d12dda6f9821e7a79ed4f16032b8e93565 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 11 Mar 2019 18:18:47 +0100 Subject: [PATCH] Add button control when no relay configured Add button control when no relay configured (#4682) --- sonoff/_changelog.ino | 1 + sonoff/support_button.ino | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index 5cce34d71..63e229fdc 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -3,6 +3,7 @@ * Add support for sensor SCD30 (#5434) * Add support for commands in sensor drivers * Add 0x to IRRemote (SetOption29) and RCSwitch (SetOption28) received hexadecimal data (#5431) + * Add button control when no relay configured (#4682) * * 6.4.1.20 20190304 * Changed webserver content handling from single String to small Chunks increasing RAM diff --git a/sonoff/support_button.ino b/sonoff/support_button.ino index ad17edd77..c0fe14bd2 100644 --- a/sonoff/support_button.ino +++ b/sonoff/support_button.ino @@ -95,8 +95,9 @@ void ButtonHandler(void) uint16_t loops_per_second = 1000 / Settings.button_debounce; char scmnd[20]; - uint8_t maxdev = (devices_present > MAX_KEYS) ? MAX_KEYS : devices_present; - for (uint8_t button_index = 0; button_index < maxdev; button_index++) { +// uint8_t maxdev = (devices_present > MAX_KEYS) ? MAX_KEYS : devices_present; +// for (uint8_t button_index = 0; button_index < maxdev; button_index++) { + for (uint8_t button_index = 0; button_index < MAX_KEYS; button_index++) { button = NOT_PRESSED; button_present = 0;