Repository navigation
Move device configs into devices/ subfolder - #87
Merged
Merged
Conversation
The repo root had grown cluttered with 21 device yamls mixed in among repo-level files. The ESPHome dashboard only scans the top level of its config directory, so the device yamls, their packages/, and secrets.yaml now live together in devices/, which becomes the directory mounted as /config in the container. Everything repo-level (components/, docs/, scripts/, lint config) stays at the root. Devices reference custom components as ../components rather than ./components, which resolves identically inside the container and from a host esphome CLI run, provided components/ is bind-mounted alongside devices/. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repo root had accumulated 21 device yamls sitting alongside the files that describe the repo itself — lint config, docs, scripts, license — and finding anything meant scrolling past the device list. The ESPHome dashboard only scans the top level of its config directory, so the devices could not simply be filed into a subfolder while the container still mounted the repo root; the fix is to move the whole config surface down one level and point the container at that instead.
devices/now holds the device yamls, theirpackages/, andsecrets.yaml, and is what gets mounted as/config. Everything repo-level —components/,docs/,scripts/, lint config — stays at the root, out of the dashboard's way.The one config change this forces is how devices reach the custom components.
components/deliberately stays at the repo root (it is a published surface, consumed by external users viasource: github://nuttytree/ESPHome-Devices), so the five devices that use local components now reference../components. That path resolves identically from the container and from a hostesphomeCLI run, which is what keeps both workflows working off the same yaml.Changes:
packages/, andsecrets.yamlintodevices/. Git recorded all 40 as renames, so history follows the files.external_componentsatpath: ../componentsinhvac,master-bed,pool-lights,pool, andwater-heater. The!include ./packages/...lines andpackages/secrets.yaml's!include ../secrets.yamlneeded no change, since those moved together..gitignore:/secrets.yamland/build/become/devices/secrets.yamland/devices/build/(build_path: ./build/${device_id}resolves relative to the device yaml, so builds now land underdevices/). Also ignore/devices/.gitignore, which ESPHome rewrites on every compile when absent and whose rules are already covered here.scripts/tag_esphome_version.pyto globdevices/*.yamland readdevices/.esphome/.device-builder-devices.json. Without this the post-commit tagging hook would silently find no devices and skip forever.README.md,CLAUDE.md, and the fourdocs/*/README.mdpages, and describe the new layout and the mount arrangement.Requires a docker change on upgrade: the container must mount
devicesas/configandcomponentsalongside it, or../componentswill resolve outside the mount and the five affected devices will fail validation.Device Builder state (
.esphome/,.device-builder*) was moved intodevices/out of band rather than in this commit, since it is untracked local state. Because the mount point is still/config, the absolute paths baked into the existing build caches stay valid and nothing needs rebuilding.Verified with
esphome configon all 21 device yamls from their new location — all valid, including every device that resolves a local component through the new../componentspath.pre_commit run --all-filespasses clean.