Skip to content

Feat: weekly display scheduler (mode/animation per half-hour)#7

Closed
Dcomp-commits wants to merge 1 commit into
psykokwak-com:masterfrom
Dcomp-commits:feature/scheduler
Closed

Feat: weekly display scheduler (mode/animation per half-hour)#7
Dcomp-commits wants to merge 1 commit into
psykokwak-com:masterfrom
Dcomp-commits:feature/scheduler

Conversation

@Dcomp-commits
Copy link
Copy Markdown

Weekly Display Scheduler

Adds a configurable weekly scheduler that automatically switches the display mode and animation every half-hour.

Features

  • 7-day x 48-slot (30-min granularity) visual grid editor
  • Per-slot rules: mode, animation, speed, brightness min/max, LED color, color randomization
  • Color-coded grid cells (actual LED color as background, auto readable text)
  • Rule numbering in cells and rule list
  • Bulk EEPROM save - single POST for all 336 slots (no sequential per-slot requests)
  • Rules applied automatically by handleScheduler() called from loop()
  • Enable/disable toggle with EEPROM persistence

New server routes

Route Method Description
/admin/schedulerconfig GET Returns enabled flag
/admin/schedulerdata GET Returns 336 slots as hex dump
/admin/save/schedulerbulk POST Bulk write all 336 slots at once
/admin/save/schedulerenabled POST Toggle enabled flag
/admin/scheduler/apply POST Force immediate re-apply of current slot

EEPROM changes

  • EEPROM_SIZE increased from 1024 to 4096 bytes
  • Scheduler base offset: 1024, 336 slots x 8 bytes = 2688 bytes
  • Slot layout: [0]=mode (0xFF=disabled), [1]=anim, [2]=(colorRandom&0x03)|((animSpeed-1)<<2), [3]=animBrightMin, [4]=animBrightMax, [5]=R, [6]=G, [7]=B

Breaking change: EEPROM offsets 1024+ are overwritten. Recommend RAZ (reset all slots) after first flash.

Files changed

  • global.h: added SCHEDULER_EEPROM_BASE, SCHEDULER_SLOT_SIZE, bumped EEPROM_SIZE to 4096
  • TexTime.ino: include Page_scheduler.h, new routes, handleScheduler() in loop()
  • Page_scheduler.h: new file - all scheduler backend (read/write/bulk/apply)
  • Page_index.h: scheduler UI section with grid editor and rule editor
  • Page_style.css.h: scheduler grid and compact editor styles

Programmateur d'affichage hebdomadaire

Ajoute un programmateur hebdomadaire configurable qui change automatiquement le mode d'affichage et l'animation toutes les demi-heures.

Fonctionnalites

  • Grille visuelle 7 jours x 48 creneaux (granularite 30 min)
  • Regles par creneau : mode, animation, vitesse, luminosite min/max, couleur LED, randomisation
  • Cellules colorees avec la vraie couleur LED (texte lisible automatiquement)
  • Numerotation des regles dans les cellules et la liste
  • Sauvegarde EEPROM groupee - un seul POST pour les 336 creneaux
  • Application automatique via handleScheduler() appele depuis loop()
  • Activation/desactivation avec persistance EEPROM

Nouvelles routes serveur

Route Methode Description
/admin/schedulerconfig GET Retourne le flag active/desactive
/admin/schedulerdata GET Retourne les 336 creneaux en hex
/admin/save/schedulerbulk POST Ecriture groupee des 336 creneaux
/admin/save/schedulerenabled POST Bascule le flag active/desactive
/admin/scheduler/apply POST Force l'application immediate du creneau courant

Modifications EEPROM

  • EEPROM_SIZE augmente de 1024 a 4096 octets
  • Base du programmateur : offset 1024, 336 creneaux x 8 octets = 2688 octets
  • Format du creneau : [0]=mode (0xFF=desactive), [1]=anim, [2]=(colorRandom&0x03)|((animSpeed-1)<<2), [3]=animBrightMin, [4]=animBrightMax, [5]=R, [6]=G, [7]=B

Changement incompatible : les offsets EEPROM a partir de 1024 sont ecrases. Faire un RAZ (remise a zero de tous les creneaux) apres le premier flash.

Fichiers modifies

  • global.h : ajout SCHEDULER_EEPROM_BASE, SCHEDULER_SLOT_SIZE, EEPROM_SIZE passe a 4096
  • TexTime.ino : inclusion Page_scheduler.h, nouvelles routes, handleScheduler() dans loop()
  • Page_scheduler.h : nouveau fichier - toute la logique backend du programmateur
  • Page_index.h : section UI du programmateur avec grille et editeur de regles
  • Page_style.css.h : styles de la grille et de l'editeur compact

Adds a weekly scheduler that overrides the general display settings at
configurable half-hour intervals. Users define rules (mode, color,
color randomization, animation, speed, brightness range) then paint
time slots in a 7-day × 24-hour grid (each hour split in two halves).

Implementation:
- Page_scheduler.h: EEPROM read/write for 336 half-hour slots (7×48×8B),
  bulk save endpoint, apply-now endpoint, handleScheduler() called from loop()
- Page_index.h: scheduler section with rule editor and interactive grid;
  click/drag to paint slots; single bulk POST to save entire grid at once
- Page_style.css.h: scheduler grid and rule list CSS
- global.h: SCHEDULER_EEPROM_BASE (1024) and SCHEDULER_SLOT_SIZE (8) defines
- TexTime.ino: EEPROM.begin 1024→4096, include + routes + loop call

EEPROM usage: existing config ends at ~778; scheduler starts at 1024,
uses 2689 bytes (1 header + 336×8). Total: 3713 / 4096 bytes.
ESP8266 supports EEPROM.begin() up to 4096 bytes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Dcomp-commits
Copy link
Copy Markdown
Author

Remplacé par #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant