add support for up to 10 ESPNow remotes (#4654)

* add support for up to 10 ESPNow remotes

* removed debug line

* changed todo comment

* fixed some issues, shortened html/java code

- reverting name to `linked_remote`
- ESPNow remote list is now hidden if unchecked
- shortened java script function names and variables to save flash
- removed now obsolete settings in xml.cpp
- correct checking of valid hex string for remote list in java script

* fixed indentation, using emplace_back instead of push_back, using JsonVariant, replaced buttons with +/-

* shortened java code

* updated java code, fixed bug

- element is now properly removed
- `+` button is hidden if list is full
- user needs to remove a remote, then reload the page to add it (workaround for edge case that needs more code to handle otherwise)

* add limit

* clearer usage description
This commit is contained in:
Damian Schneider
2025-05-19 20:34:27 +02:00
committed by GitHub
parent d9ad4ec743
commit 66ad27ad3a
7 changed files with 108 additions and 28 deletions

View File

@@ -538,7 +538,8 @@ WLED_GLOBAL bool serialCanTX _INIT(false);
WLED_GLOBAL bool enableESPNow _INIT(false); // global on/off for ESP-NOW
WLED_GLOBAL byte statusESPNow _INIT(ESP_NOW_STATE_UNINIT); // state of ESP-NOW stack (0 uninitialised, 1 initialised, 2 error)
WLED_GLOBAL bool useESPNowSync _INIT(false); // use ESP-NOW wireless technology for sync
WLED_GLOBAL char linked_remote[13] _INIT(""); // MAC of ESP-NOW remote (Wiz Mote)
//WLED_GLOBAL char linked_remote[13] _INIT(""); // MAC of ESP-NOW remote (Wiz Mote)
WLED_GLOBAL std::vector<std::array<char, 13>> linked_remotes; // MAC of ESP-NOW remotes (Wiz Mote)
WLED_GLOBAL char last_signal_src[13] _INIT(""); // last seen ESP-NOW sender
#endif