Skip to content

Feat: scheduler + i18n FR/EN + HSV color picker + animations#9

Open
Dcomp-commits wants to merge 15 commits into
psykokwak-com:masterfrom
Dcomp-commits:feature/complete
Open

Feat: scheduler + i18n FR/EN + HSV color picker + animations#9
Dcomp-commits wants to merge 15 commits into
psykokwak-com:masterfrom
Dcomp-commits:feature/complete

Conversation

@Dcomp-commits
Copy link
Copy Markdown

@Dcomp-commits Dcomp-commits commented May 17, 2026

Summary / Résumé

EN — Combines the weekly display scheduler (PR #7) and the full FR/EN interface translation (PR #8), plus a custom HSV color picker, animation controls, Tetris & Snake games, and various bugfixes.

FR — Combine le programmateur d'affichage hebdomadaire (PR #7) et la traduction complète FR/EN de l'interface (PR #8), ainsi qu'un sélecteur de couleur HSV personnalisé, des contrôles d'animation, les jeux Tetris & Snake, et divers correctifs.


Weekly Display Scheduler / Programmateur d'affichage hebdomadaire

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

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

Features / Fonctionnalités

  • 7-day × 48-slot (30-min granularity) visual grid editor / Grille visuelle 7 jours × 48 créneaux (granularité 30 min)
  • Per-slot rules: mode, animation, speed, brightness min/max, LED color, color randomization / Règles par créneau : mode, animation, vitesse, luminosité min/max, couleur LED, randomisation
  • Color-coded grid cells (actual LED color, auto readable text) / Cellules colorées avec la vraie couleur LED (texte lisible automatiquement)
  • Rule numbering in cells and rule list / Numérotation des règles dans les cellules et la liste
  • Bulk EEPROM save — single POST for all 336 slots / Sauvegarde EEPROM groupée — un seul POST pour les 336 créneaux
  • Rules applied automatically by handleScheduler() called from loop() / Application automatique via handleScheduler() appelé depuis loop()
  • Enable/disable toggle with EEPROM persistence / Activation/désactivation avec persistance EEPROM

New server routes / Nouvelles routes serveur

Route Method Description (EN) Description (FR)
/admin/schedulerconfig GET Returns enabled flag Retourne le flag activé/désactivé
/admin/schedulerdata GET Returns 336 slots as hex dump Retourne les 336 créneaux en hex
/admin/save/schedulerbulk POST Bulk write all 336 slots Écriture groupée des 336 créneaux
/admin/save/schedulerenabled POST Toggle enabled flag Bascule le flag activé/désactivé
/admin/scheduler/apply POST Force immediate re-apply Force l'application immédiate du créneau courant

EEPROM changes / Modifications EEPROM

  • EEPROM_SIZE increased from 1024 to 4096 bytes / augmenté de 1024 à 4096 octets
  • Scheduler base offset: 1024, 336 slots × 8 bytes = 2688 bytes / Base offset 1024, 336 créneaux × 8 octets = 2688 octets
  • 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 / Changement incompatible: EEPROM offsets 1024+ are overwritten. Recommend RAZ (reset all slots) after first flash. / Les offsets EEPROM à partir de 1024 sont écrasés. Faire un RAZ après le premier flash.


FR/EN Interface Translation / Traduction de l'interface FR/EN

EN — The entire dashboard UI switches to French or English instantly when the user changes the Language dropdown in General Settings. ~100 translation keys per language covering all labels, buttons, card titles, status messages, scheduler grid day names, and confirm dialogs. No server-side cost: a single new endpoint (/admin/langvalue) returns the saved language index; all translation logic runs in the browser.

FR — L'ensemble de l'interface bascule en français ou en anglais instantanément quand l'utilisateur change la liste déroulante Langue dans les paramètres généraux. ~100 clés de traduction par langue couvrant tous les libellés, boutons, titres de cartes, messages d'état, noms de jours de la grille et boîtes de confirmation. Aucun coût côté serveur : un seul nouvel endpoint (/admin/langvalue) retourne l'index de langue sauvegardé ; toute la logique de traduction s'exécute dans le navigateur.

Implementation / Implémentation

  • Page_general.h — new send_lang_value_html() serving /admin/langvalue / nouveau send_lang_value_html() pour /admin/langvalue
  • Page_index.hdata-i18n attributes on all static text; I18N dictionary (FR/EN); T() / applyI18n() / initI18n() helpers; updatelang() calls applyI18n() immediately; loadGeneralSettings() re-syncs currentLang after AJAX reload; all JS-generated strings use T() / attributs data-i18n sur tout le texte statique ; dictionnaire I18N (FR/EN) ; helpers T() / applyI18n() / initI18n() ; updatelang() appelle applyI18n() immédiatement ; loadGeneralSettings() resynchronise currentLang après rechargement AJAX ; toutes les chaînes JS générées utilisent T()
  • TexTime.ino — registers /admin/langvalue; fixes setAPssid() (missing APPassword argument) / enregistre /admin/langvalue ; corrige setAPssid() (argument APPassword manquant)

Other changes / Autres modifications

  • HSV color picker: custom SV square + hue slider replaces native <input type="color">, in both General Settings and the scheduler rule editor / Sélecteur de couleur HSV personnalisé (carré SV + curseur de teinte) remplaçant <input type="color">, dans les paramètres généraux et dans l'éditeur de règles du programmateur
  • Animation controls: speed, min/max brightness sliders (general settings + scheduler) / Contrôles d'animation : curseurs de vitesse et luminosité min/max
  • Tetris & Snake: playable games accessible from the sidebar / Jeux Tetris et Snake accessibles depuis la barre latérale
  • 5 new LED animation effects / 5 nouveaux effets d'animation LED
  • WiFi/NTP bugfixes / Correctifs WiFi/NTP

Files changed / Fichiers modifiés

  • global.h : SCHEDULER_EEPROM_BASE, SCHEDULER_SLOT_SIZE, EEPROM_SIZE → 4096
  • TexTime.ino : Page_scheduler.h include, new routes, handleScheduler() in loop(), /admin/langvalue, setAPssid() fix
  • Page_scheduler.h : new file — full scheduler backend / nouveau fichier — backend complet du programmateur
  • Page_index.h : scheduler UI + i18n + HSV picker + animation controls
  • Page_general.h : send_lang_value_html()
  • Page_style.css.h : scheduler grid styles + HSV picker styles / styles grille + styles sélecteur HSV
  • LedStrip.h, Page_tetris.h, Page_snake.h : new animations + games / nouvelles animations + jeux
  • WiFiMgr.cpp, WiFiMgr.h, NTP.h, Page_network.h : bugfixes

Test plan / Plan de test

  • Compile with esp8266:esp8266:nodemcuv2 (verified: 50% flash, 94% IRAM) / Compiler avec esp8266:esp8266:nodemcuv2 (vérifié : 50% flash, 94% IRAM)
  • OTA flash and verify web interface loads / Flash OTA et vérifier le chargement de l'interface
  • FR device → UI displays in French on load / Appareil en FR → interface en français au chargement
  • Change Language to English → UI switches instantly, no reload / Changer Langue en anglais → basculement instantané sans rechargement
  • Save → reload → language persists / Sauvegarder → recharger → la langue persiste
  • All sections fully translated (General, Network, NTP, MQTT, Scheduler, Firmware) / Toutes les sections traduites
  • Scheduler RAZ confirm dialog and day labels translated / Boîte de confirmation RAZ et noms de jours traduits
  • Save/Saving/Saved/Error button states translated / États bouton Enregistrement/Enregistré/Erreur traduits
  • Scheduler: create rules, paint grid, save, verify applies on next half-hour / Programmateur : créer des règles, peindre la grille, sauvegarder, vérifier l'application à la demi-heure suivante
  • HSV picker: click swatch, drag SV square and hue slider, color updates live / Sélecteur HSV : cliquer la pastille, glisser carré SV et curseur teinte, couleur mise à jour en temps réel
  • Tetris and Snake load via sidebar links / Tetris et Snake accessibles via la barre latérale
  • RAZ after first flash (EEPROM breaking change) / RAZ après le premier flash (changement incompatible EEPROM)

Closes #7
Closes #8

🤖 Generated with Claude Code

Dcomp-commits and others added 13 commits May 16, 2026 21:23
New features:
- Page_tetris.h: Tetris game playable via web interface on LED matrix
- Page_snake.h: Snake game playable via web interface on LED matrix
- LedStrip.h: 5 new animations + improvements to existing ones

Bug fixes:
- global.h: EEPROM reset now covers full 1024 bytes (was 511); off-by-one
  in ReadStringFromEEPROM; WriteStringToEEPROM truncates to maxLen; passwords
  masked in printConfig; add AP_DEFAULT_PASSWORD, EEPROM_SIZE constants;
  add brightnessMax, APPassword, animSpeed/Min/Max fields with EEPROM R/W;
  timezone sanity check on ReadConfig
- WiFiMgr.h: timers unsigned int -> unsigned long (overflow fix at ~65s)
- WiFiMgr.cpp: static IP applied before WiFi.begin (DHCP conflict fix);
  password removed from Serial logs; AP address 192.168.1.1 -> 192.168.4.1;
  setAutoReconnect(false) before AP mode; WPA2 key length check >= 8;
  STA timeout 10s -> 30s for WiFi 6 compatibility
- NTP.h: integer overflow fix in timezone calculation (cast to long)
- TexTime.ino: use EEPROM_SIZE constant; default config initializes all new
  fields and calls WriteConfig(); setAPssid passes APPassword; tryToConnect
  uses const String& signature; setTimeout overflow cast; add game routes
- Page_network.h: passwords not returned to browser on page load;
  APPassword field added (min 8 chars, only saved if valid length)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Page_index.h: add speed, min/max brightness sliders for animations;
  add Tetris and Snake links in sidebar navigation
- Page_general.h: expose animSpeed/animBrightnessMin/Max in config
  values endpoint and live LED update handler
- TexTime.ino: save animSpeed/animBrightnessMin/Max in /admin/save/general

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The timezone select uses 1/10th-hour units (GMT+1 = value 10).
Correct multiplier is 360 (10 * 360 = 3600s = 1h).
The (long) cast is kept to prevent int overflow for UTC+9 and above.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prevents setAnimation() from silently falling back to index 0 (Normal)
when EEPROM contains an out-of-range animation value (e.g. 0xFF on first
boot or after firmware downgrade).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use QTLed.setAnimSpeed() instead of directly writing _config.animSpeed,
so begin() is called on the current animation and the new FPS takes
effect in real-time without requiring Save.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace absolute Darken(35) with a distance-based proportional fade so
the tail remains visible at any brightness level. Previously, low
animBrightnessMax values caused the trail to reach black in 2-3 pixels,
making variable trail lengths invisible.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add copyForeground() at the end of the FLASH phase, consistent with
BUILD and FADE which already do this. Background pixels still flash
white but word pixels are restored on top.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
initializeColorPicker() now explicitly syncs colorText.value to
colorInput.value after setValues() loads server data. setValues()
sets colorText programmatically (no 'input' event fires), leaving
colorInput stuck at #000000.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces browser-native color picker with a custom inline picker:
- Colored swatch (click to open/close)
- 2D saturation/value square (drag to pick)
- Hue rainbow slider
- Hex text input stays for direct entry
- Works identically on Android and desktop
- CSS loaded with ?t=timestamp to prevent stale cache

Fixes Android Chrome "Personnalise" HSV sliders defaulting to 0,0,0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
setValues() sets element.value programmatically without firing oninput,
so animspeedt, animbrightmint and animbrightmaxt stayed at '--' after
loading stored settings. Sync them explicitly in the loadGeneralSettings
callback once all setValues() calls have resolved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
Combines:
- HSV color picker + animspeed/bright controls (improvements-2026)
- Tetris & Snake games (improvements-2026)
- New animations + WiFiMgr fixes (improvements-2026)
- Display scheduler weekly grid (feature/scheduler)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- JS i18n dictionary (~100 keys, FR + EN)
- data-i18n attributes on all static text elements
- T(key) lookup, applyI18n(), initI18n() fetching /admin/langvalue
- Language change updates UI immediately without page reload
- Scheduler day labels and button states also translated
- HSV color picker preserved in both general settings and scheduler

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dcomp-commits and others added 2 commits May 17, 2026 23:10
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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