feat: optimize neopattern example

This commit is contained in:
2025-09-20 22:05:52 +02:00
parent 51d4d4bc94
commit c11652c123
8 changed files with 737 additions and 487 deletions

View File

@@ -4,6 +4,7 @@
#include "NeoPattern.h"
#include "NeoPatternState.h"
#include "NeoPixelConfig.h"
#include "PatternRegistry.h"
#include <map>
#include <functional>
@@ -70,14 +71,21 @@ private:
NeoPatternType nameToPattern(const String& name) const;
void resetStateForPattern(NeoPatternType pattern);
uint32_t parseColor(const String& colorStr) const;
// Pattern validation methods
bool isValidPattern(const String& name) const;
bool isValidPattern(NeoPatternType type) const;
bool patternRequiresColor2(const String& name) const;
bool patternSupportsDirection(const String& name) const;
String getPatternDescription(const String& name) const;
TaskManager& taskManager;
NeoPattern* neoPattern;
NeoPixelConfig config;
NeoPatternState currentState;
std::map<String, std::function<void()>> patternUpdaters;
std::map<String, NeoPatternType> nameToPatternMap;
// Pattern registry for centralized pattern management
PatternRegistry patternRegistry;
NeoPatternType activePattern;
NeoDirection direction;