first try

This commit is contained in:
proddy
2026-06-07 18:26:35 +02:00
parent f4cee54042
commit 5c4dfcb9ae
38 changed files with 1282 additions and 439 deletions

View File

@@ -41,11 +41,9 @@
// 128 (0x80) is timer
// 129 (0x81) is on change
// 130 (0x82) is on condition
// 132 (0x84) is immediate
#define SCHEDULEFLAG_SCHEDULE_TIMER 0x80 // 7th bit for Timer
#define SCHEDULEFLAG_SCHEDULE_ONCHANGE 0x81 // 7th+1st bit for OnChange
#define SCHEDULEFLAG_SCHEDULE_CONDITION 0x82 // 7th+2nd bit for Condition
#define SCHEDULEFLAG_SCHEDULE_IMMEDIATE 0x84 // 7th+3rd bit for Immediate
#define MAX_STARTUP_RETRIES 3 // retry the start-up commands x times
@@ -57,8 +55,7 @@ class ScheduleItem {
uint8_t flags; // bit flags, see SCHEDULEFLAG_* defines
uint16_t elapsed_min; // total mins from 00:00
stringPSRAM time; // HH:MM
stringPSRAM cmd;
stringPSRAM value;
stringPSRAM cmd_name; // references a named command from WebCommandService
char name[20];
uint8_t retry_cnt;
};
@@ -88,8 +85,6 @@ class WebSchedulerService : public StatefulService<WebScheduler> {
uint8_t count_entities();
bool onChange(const char * cmd);
bool executeSchedule(const char * name);
std::string get_metrics_prometheus();
std::string raw_value;
@@ -105,7 +100,7 @@ class WebSchedulerService : public StatefulService<WebScheduler> {
#endif
static void scheduler_task(void * pvParameters);
bool command(const char * name, const std::string & cmd, const std::string & data);
bool runScheduleCommand(const ScheduleItem & si);
void condition();
HttpEndpoint<WebScheduler> _httpEndpoint;