Comments und add licence
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
// Aquacross Timer - ESP32 Master (Webserver + ESP-NOW + Anlernmodus)
|
||||
#include <ESPAsyncWebServer.h>
|
||||
|
||||
// Weist im Lernmodus eine MAC-Adresse dem nächsten freien Button zu, sofern sie
|
||||
// noch nicht vergeben ist
|
||||
void handleLearningMode(const uint8_t *mac) {
|
||||
// Prüfen ob MAC bereits einem anderen Button zugewiesen ist
|
||||
if (buttonConfigs.start1.isAssigned &&
|
||||
@@ -61,6 +63,8 @@ void handleLearningMode(const uint8_t *mac) {
|
||||
}
|
||||
}
|
||||
|
||||
// Startet den Lernmodus und setzt den Lernschritt entsprechend der bereits
|
||||
// zugewiesenen Buttons
|
||||
void handleStartLearning() {
|
||||
learningMode = true;
|
||||
|
||||
@@ -82,6 +86,7 @@ void handleStartLearning() {
|
||||
assignedButtons, learningStep);
|
||||
}
|
||||
|
||||
// Erstellt ein JSON mit Status und aktuellem Lernschritt des Lernmodus
|
||||
void handleLearningStatus() {
|
||||
DynamicJsonDocument doc(256);
|
||||
doc["active"] = learningMode;
|
||||
@@ -91,6 +96,7 @@ void handleLearningStatus() {
|
||||
serializeJson(doc, response);
|
||||
}
|
||||
|
||||
// Setzt alle Button-Zuweisungen zurück und speichert die Konfiguration
|
||||
void unlearnButton() {
|
||||
|
||||
memset(buttonConfigs.start1.mac, 0, 6);
|
||||
|
||||
Reference in New Issue
Block a user