Skip to content

Latest commit

 

History

History
361 lines (300 loc) · 15.5 KB

File metadata and controls

361 lines (300 loc) · 15.5 KB

Changelog

All notable changes to the Life Matrix component will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[2.1.0] - 2026-03-22

Added

  • Entity name prefixes for logical grouping in the HA device page and ESPHome web UI — all auto-generated entities now carry a prefix so they sort into visual groups: Screens:, Appearance:, Display:, Time Segments:, Game of Life:, Pomodoro:, Lifespan:
  • Lifespan entities in Diagnostic category — biographical data (birthday, kids, parents, milestones, partner/marriage ranges, school years, retirement, life expectancy, phase cycle) appear in HA's collapsed "Diagnostic" section rather than the main Configuration section
  • Debug entities in Diagnostic sectionTime Override and Pomodoro Test Phase appear in HA's Diagnostic section (alongside the Lifespan biographical fields) rather than the main Configuration section

Fixed

  • NVS key stabilityfinalize_entity_config() now accepts an explicit object_id for hash computation so entity display names can be changed without wiping saved device states

[2.0.0] - 2026-03-11

Changed

  • Architecture: Entity auto-generation — All 47 Home Assistant entities (switches, selects, numbers, texts, buttons, sensors) are now auto-generated by the component. No manual YAML entity definitions needed.
  • NVS persistence — Custom LM* entity classes persist settings across reboots using ESP-IDF NVS, without relying on YAML restore_value.
  • Simplified YAML — Removed ~800 lines from user configuration. Entity management moved entirely to C++/Python code generation.
  • Removed OTA UI — OTA progress display removed from component (simplifies code, use standard ESPHome OTA indicators).

Added

  • show_future toggle now applies to all screens (Year, Month, Lifespan, Pomodoro) via unified dim_future() function.
  • Entity count defines (ESPHOME_ENTITY_*_COUNT) set at module import time for correct StaticVector sizing.
  • display: config key to wire display brightness callback from YAML.
  • lifespan: config block for biographical data (replaces scattered text/number entities).
  • Auto-generated screen switches with NVS-backed state restoration.
  • Auto-generated config switches: show_future, complex_patterns, exercise_snacks.
  • Auto-generated select entities: style, gradient_type, fill_direction, marker_style, marker_color, day_fill, year_event_style, conway_speed, pomodoro_preset.
  • Auto-generated number entities: brightness, night_mode, cycle_time, bed_time, work hours, pomodoro_rounds, lifespan fields.
  • Auto-generated text entities: year_events, exercise_list, time_override, lifespan biographical fields.
  • Auto-generated button: pomodoro_start.
  • Auto-generated text sensors: pomodoro_event, pomodoro_exercise.

Breaking Changes

  • Requires config update — Remove all manual switch:, select:, number:, text:, button:, text_sensor: definitions from your YAML.
  • Use new display: and lifespan: config blocks under life_matrix: instead.
  • OTA event handlers (on_begin, on_progress, on_end) removed from YAML.
  • on_boot lambda for entity wiring is no longer needed — remove it.

[1.2.0] - 2026-02-28

Added

  • Pomodoro Timer screen (screen ID 7) — work/break timer with spiral visualization
    • Three presets: Classic (25/5), Deep Work (50/10), Ultradian (90/20)
    • Configurable rounds before long break (2-8)
    • Exercise snack reminders after work sessions (configurable exercise list)
    • Work complete celebration animations
    • Session time display with elapsed/fill visualization
    • Idle screen shows session preview and animated play icon
  • Icon registry system — framework for animated icons with frame durations and playback
    • register_icon_frames() for registering animated icons from YAML
    • draw_icon() with optional tint color
    • Automatic frame advancement based on per-frame durations
    • LaMetric icon cache support for downloading icons at compile time
  • Night mode dimming — automatic brightness reduction during night hours
  • Exercise Snacks toggle in on-device settings menu — pomodoro screen shows "ExSnc" (On/Off) as 5th setting
  • Bidirectional sync between physical "ExSnc" toggle and HA exercise_snacks switch

Changed

  • Simplified YAML configuration — moved display lambda logic into C++ methods
    • OTA progress rendering handled in component
    • Settings overlay rendering handled in component
  • Removed unused color definitions from YAML (c_active, c_weekend, c_marker, c_highlight)

[1.1.0] - 2026-02-21

Added

  • Lifespan screen (screen ID 5, Game of Life moved to ID 6) — biographical life visualization
    • Life phases rendered per-row: Parents home, School (primary/highschool/university split), Career, Retirement
    • Relationship markers: kids, parents lost, siblings lost, partner ranges, marriage ranges, milestones
    • Decade tick markers using the Marker Color setting; event/milestone markers use complementary color of current phase blend (matching year view behavior)
    • Phase color animation with configurable cycle time
    • Celebration animations (sparkle + plasma) on significant event days
  • Cosmos death visualization — starfield with nebula gradient for rows beyond life expectancy
    • Per-pixel deterministic star hash with sinf-based independent twinkle
    • Four star types (bright white, white, blue-white, amber) across full width (columns 0–31)
    • Near-black nebula background with blue→indigo depth gradient
  • Lifespan web interface entities — all biographical fields configurable via HA dashboard without reflashing
    • Text inputs: birthday, kids birth dates, parents birth/death ranges, siblings birth dates, partner/marriage date ranges, milestones
    • Number inputs: moved out age (14–40), school years (8–25), retirement age (50–90), life expectancy (40–110), phase cycle time (0–30 s)
  • Month view rewrite — 4×8 day grid with activity fill, event borders, and today indicator
  • Current-time progress row in today's cell (left/elapsed portion at full brightness)
  • European Mon–Sun week coloring for Time Segments style in month view
  • Marker style "None" suppresses the today rectangle in month view
  • Month view settings accessible from the physical settings menu

Changed

  • Screen IDs renumbered: Lifespan=5, Game of Life=6 (previously GoL was screen 5)
  • Life expectancy default increased from 80 to 90 years
  • moved_out, school_years, retirement are now integer ages, not date strings
  • Removed life-end orange marker line; cosmos visualization occupies all 32 columns
  • is_grave threshold changed to age >= life_expectancy_age (inclusive)

Fixed

  • "Set bday" prompt now fits on screen (split across two lines)

[1.0.0] - 2026-02-20

First stable release. All five screens fully implemented and rendering, physical UI (encoders + buttons) functional, Home Assistant entity sync complete, and Game of Life running only when visible. Tested on Adafruit Matrix Portal S3.

[1.0.0-beta.3] - 2026-02-17

Fixed

  • Game of Life now only runs when visible (not in background) - saves CPU and prevents issues
  • Web interface screen toggle switches now properly sync with physical UI state
  • Neopixel status LED now shows UI mode (Blue=Auto, Green=Manual, Yellow=Settings) instead of mirroring current pixel
  • GoL auto-reset timeout fixed - properly waits 60s after stability before reset
  • Settings mode now pauses screen cycling to prevent unexpected screen jumps during adjustment

Added

  • Time override feature for testing visualizations - set custom time via web interface (format: YYYY-MM-DD HH:MM:SS)
  • Bidirectional sync between physical encoders and Home Assistant entities
  • Better integration between web interface controls and physical device state

Changed

  • Improved screen registration system for better enable/disable handling
  • Enhanced HA entity synchronization on boot

Status

  • Ready for hardware beta testing
  • ✅ All 6 screens rendering at 100%
  • ✅ Physical UI fully functional with 2 encoders + buttons
  • ✅ Web interface fully synced with device state
  • ✅ OTA updates with progress display working

[1.0.0-beta.2] - 2026-02-16

Added - ALL FEATURES NOW COMPLETE! 🎉

  • Settings adjustment system (adjust_setting() method) - Lines 338-485
    • Global settings: cycle time, text area position
    • Hour screen: color scheme, gradient type, fill direction, marker style/color
    • Day screen: bed time, work start/end hours
    • Game of Life: speed (50/100/200/500/1000ms), complex patterns toggle
    • Year screen: color scheme, marker style, day/event styles
    • Helper lambdas for cycling enums and adjusting numbers with wrapping
    • Flash animation timing for visual feedback
  • ✅ Confirmed hour view spiral algorithm is fully implemented
  • ✅ Confirmed year view calendar layout is fully implemented

Changed

  • Updated IMPLEMENTATION_SUMMARY.md to reflect 100% feature completion
  • Component now ready for hardware beta testing

Status

  • All high-priority features complete
  • 100% feature parity with original YAML implementation
  • Ready for beta testing on hardware
  • Code reduction: 92.7% (2394 → 175 lines of user YAML)
  • Component size: ~1520 lines C++, 306 lines header, 140 lines Python schema

[1.0.0-beta.1] - 2026-02-16

Added

Core Component

  • Initial release of Life Matrix ESPHome component
  • Extracted from monolithic YAML implementation into reusable C++ component
  • Full Python configuration schema for easy customization
  • Component-based architecture for clean separation of concerns

Visualization Screens

  • Year View: Calendar heatmap for all 365 days
  • Month View: Progress bar with gradient coloring
  • Day View: Sleep/Work/Life segmentation with rainbow visualization
  • Hour View: Current hour progress with multiple color schemes
  • Game of Life: Conway's cellular automaton with age-based coloring
  • Habits View: Placeholder for future habit tracking

Game of Life Features

  • Complex pattern initialization (R-pentomino, Acorn, Glider, Diehard)
  • Age tracking for cells (0-255)
  • Age-based color progression (cyan → green → yellow → rainbow)
  • Toroidal grid topology (wraps at edges)
  • Configurable update intervals (50ms - 1000ms)
  • Smart auto-reset detection:
    • Extinction detection (all cells dead)
    • Low population detection (< 58 cells)
    • Stability detection via population variance
  • Demo mode with rules display (first 5 seconds)
  • Generation and population statistics display

UI System

  • Three UI modes: Auto Cycle, Manual Browse, Settings
  • Auto-cycling with configurable interval (default 3s)
  • Pause/resume functionality
  • Settings menu with per-screen configurations
  • Visual mode indicators (bottom-right corner)
  • Pause indicator (top-right corner)
  • Automatic timeout: Manual → Auto (10s), Settings → Manual (10s)

Screen Management

  • Enable/disable individual screens via configuration
  • Dynamic screen registration system
  • Circular navigation (wraps at ends)
  • Screen cycle time configuration
  • Current screen tracking

Configuration Options

  • Grid dimensions (default 32×120)
  • Screen cycle time (default 3s)
  • Per-screen enable/disable
  • Game of Life settings:
    • Update interval
    • Complex patterns toggle
    • Auto-reset on stable
    • Stability timeout
    • Demo mode toggle
  • Time segments (bed time, work hours)
  • Color schemes (Single, Gradient, Time Segments, Rainbow)
  • Gradient types (Red-Blue, Green-Yellow, etc.)
  • Text area position (Top, Bottom, None)
  • Fill direction (Bottom to Top, Top to Bottom)

Integration Support

  • Rotary encoder navigation (2 encoders supported)
  • Button input for pause/reset
  • Font configuration (small and medium)
  • Color customization
  • OTA update detection with minimal UI

Performance

  • 20 FPS display update rate (50ms refresh)
  • Optimized cell neighbor counting
  • Efficient grid updates with temporary array
  • Loop time < 50ms on ESP32-S3
  • Memory-efficient: ~50KB heap free

Technical Details

C++ Component Structure

  • life_matrix.h: Component class definition with ~180 lines
  • life_matrix.cpp: Implementation with ~850 lines
  • Clean separation of concerns:
    • Game of Life logic
    • Screen management
    • UI state management
    • Rendering pipeline
    • Helper functions

Python Configuration Schema

  • __init__.py: ESPHome config validation and code generation
  • Type-safe configuration with validation
  • Enum support for color schemes
  • Nested configuration structures
  • Default values for all optional parameters

API Surface

  • 20+ public methods for external control
  • Type-safe enums for modes and screens
  • Clean integration with ESPHome lambdas
  • Callback support for button/encoder input

Documentation

  • Comprehensive README.md with:
    • Feature overview
    • Hardware requirements
    • Installation instructions
    • Full configuration reference
    • API documentation
    • Troubleshooting guide
  • Example configuration files:
    • example-minimal.yaml: Basic setup
    • Full configuration examples in README
  • Inline code documentation
  • CHANGELOG.md (this file)

Performance Benchmarks

  • Game of Life update: ~2ms for 3840 cells
  • Screen render: < 20ms for full frame
  • Total loop time: < 50ms (supports 20 FPS)
  • Memory usage: Stable, no leaks detected over 24h

Known Limitations

  • Year view simplified (event markers not fully implemented)
  • Hour view spiral filling not yet implemented
  • Habits screen is placeholder only
  • Settings adjustment system basic implementation
  • No Home Assistant entity publication (sensors/controls)

Breaking Changes

N/A - Initial release


Version History

  • v1.1.0 (2026-02-21): Lifespan screen, cosmos visualization, month view rewrite, HA lifespan entities
  • v1.0.0 (2026-02-20): First stable release
  • v1.0.0-beta.1–beta.3 (2026-02-16–17): Initial component extraction and stabilization
  • v0.x.x (2025-2026): Monolithic YAML implementation (pre-component)

Migration Guide

From Monolithic YAML to Component

If you're migrating from the original life-matrix.yaml implementation:

  1. Keep your display hardware configuration (unchanged)
  2. Keep your time, wifi, and base configurations (unchanged)
  3. Replace the massive display lambda with:
    lambda: |-
      auto time = id(sntp_time).now();
      if (time.is_valid()) {
        id(life_matrix_component)->render(it, time);
      }
  4. Add the life_matrix component block with your desired configuration
  5. Update button/encoder handlers to call component methods:
    • id(current_screen_idx)++id(life_matrix_component)->next_screen()
    • id(ui_paused) = !id(ui_paused)id(life_matrix_component)->toggle_pause()
  6. Remove globals for game state, UI mode, etc. (now internal to component)
  7. Remove scripts like adjust_setting_value, check_ui_timeout (now component methods)
  8. Simplify number/select entities (can now configure via component YAML)

Benefits of Migration

  • 90% less YAML (from 2400 lines → ~250 lines)
  • Reusable across multiple devices
  • Maintainable with proper C++ structure
  • Configurable via clean YAML schema
  • Testable with isolated component logic
  • Publishable to ESPHome community

Contributing

See README.md for contribution guidelines.

License

GPLv3 — See LICENSE file for details.