Wemos D1 Mini Frimware zur Steuerung einer RGBW-LED-Lampe
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

TimerManager.h 903B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * TimerManager.h
  3. *
  4. * Created on: 12.07.2026
  5. * Author: FSmilari
  6. */
  7. #ifndef TIMERMANAGER_H_
  8. #define TIMERMANAGER_H_
  9. #include "ConfigManager.h"
  10. #include "NTPClient.h"
  11. #include <WiFiUdp.h>
  12. class TimerManager {
  13. public:
  14. TimerManager(ConfigManager &configManager);
  15. virtual ~TimerManager();
  16. void onTimerIntervalChange(String timerIntervalName, const char *timerInterval);
  17. void saveTimerInterval(String timerIntervalName, uint32_t start, uint32_t end);
  18. bool isNowInTimeInterval();
  19. private:
  20. ConfigManager &configManager;
  21. NTPClient ntpClient;
  22. uint32_t timeToSeconds(uint8_t hour, uint8_t minute, uint8_t second);
  23. bool parseTimeInterval(const char *str, TimeInterval &interval);
  24. bool isDST(int month, int day, int weekday);
  25. bool isInInterval(uint32_t now, const TimeInterval &interval);
  26. String secondsToFormatedTime(uint32_t seconds);
  27. };
  28. #endif /* TIMERMANAGER_H_ */