Skip to content

Comments

feat!: Further modularize configuration#26

Merged
hostcc merged 1 commit intomainfrom
feat/modularize
Oct 29, 2025
Merged

feat!: Further modularize configuration#26
hostcc merged 1 commit intomainfrom
feat/modularize

Conversation

@hostcc
Copy link
Owner

@hostcc hostcc commented Oct 29, 2025

  • The configuration has been restructed to allow using minimal set of entities (main.yaml) on stock hardware, as well as optional components for custom hardware modifications (full.yaml now includes what has been known before as main.yaml). Minimal configuration now includes sprinkler schedule controls, which could still be removed if not needed.

    Users of modified hardware will need to update their configuration to reference full.yaml instead of main.yaml.

    The change includes moving custom inputs (rain and water tank sensors) and buzzer to dedicated files, accompanied by preprocessor macros to conditionally include related code only when those components are present.

  • Substitutions have been moved to a dedicated file to follow the structure

  • publish_initial_state for binary_sensor components has been renamed to trigger_on_initial_state in ESPHome 2025.7.0, the configuration has been updated accordingly.

* The configuration has been restructed to allow using minimal set of
  entities (`main.yaml`) on stock hardware, as well as optional components
  for custom hardware modifications (`full.yaml` now includes what has
  been known before as `main.yaml`). Minimal configuration now includes
  sprinkler schedule controls, which could still be removed if not needed.

  Users of modified hardware will need to update their configuration to
  reference `full.yaml` instead of `main.yaml`.

  The change includes moving custom inputs (rain and water tank sensors)
  and buzzer to dedicated files, accompanied by preprocessor macros to
  conditionally include related code only when those components are present.

* Substitutions have been moved to a dedicated file to follow the structure

* `publish_initial_state` for `binary_sensor` components has been renamed
  to `trigger_on_initial_state` in ESPHome 2025.7.0, the configuration
  has been updated accordingly.
@hostcc hostcc requested a review from Copilot October 29, 2025 20:09
@hostcc hostcc self-assigned this Oct 29, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the ESPHome sprinkler controller configuration to support optional components through conditional compilation, updates to ESPHome 2025.7.0+ API changes, and reorganizes the configuration structure for better modularity.

  • Introduces a new full.yaml configuration that includes all optional components (inputs, buzzer, display, indicators, RTC)
  • Migrates from ESPHome's deprecated publish_initial_state to trigger_on_initial_state API
  • Adds conditional compilation support using preprocessor macros (HAS_CUSTOM_INPUTS, HAS_DISPLAY, HAS_BUZZER, USE_WIFI) to allow code to work with and without optional components
  • Updates ESPHome version requirement from 2024.11.0 to 2025.7.0 and dependency from 2025.9.1 to 2025.10.3

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/rp2040w.yaml Updates test configuration to use new full.yaml instead of main.yaml
substitutions.yaml Extracts substitutions from main.yaml into a separate file for reusability
script_refill_tank.yaml Adds conditional compilation for water tank empty sensor check
script_rain_water_tank_sensors_action.yaml Wraps rain/water tank sensor logic in HAS_CUSTOM_INPUTS conditional blocks and changes from id() to pointer syntax
schedule.yaml Replaces binary_sensor.is_off with lambda-based conditional check supporting optional inputs
requirements.txt Updates ESPHome dependency to version 2025.10.3
outputs.yaml Removes buzzer-related configuration (moved to buzzer.yaml)
main.yaml Removes substitutions and optional package includes, now references substitutions.yaml and focuses on core components
inputs.yaml Adds HAS_CUSTOM_INPUTS build flag and migrates to trigger_on_initial_state
indicators.yaml Adds conditional compilation for rain sensor state check
full.yaml New file that combines main.yaml with all optional components
display.yaml Adds HAS_CUSTOM_INPUTS and USE_WIFI conditional compilation, assigns ID to SPI bus, splits sensor display formatting
buzzer.yaml New file extracted from outputs.yaml with HAS_BUZZER build flag
README.md Updates documentation to explain minimal vs full configurations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hostcc hostcc merged commit eb3f022 into main Oct 29, 2025
9 checks passed
@hostcc hostcc deleted the feat/modularize branch October 29, 2025 20:18
@github-actions
Copy link
Contributor

🎉 This pull request has been included in version 2.0.0

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant