Repository navigation
Layer the device base packages into common/chip/network - #93
Merged
Merged
Conversation
`device_base.yaml` mixed three unrelated concerns into one file: the
chip-agnostic core (api, ota, logger, diagnostics, time), and wifi --
both the `wifi:` block itself and the wifi-only diagnostics (signal
sensor, wifi-info text sensor). Because wifi was baked into the core,
there was no way to build an ethernet device without either duplicating
the whole core or including a wifi stack the board doesn't have. The
static-IP/DHCP split made it worse: `wifi/wifi.yaml` and
`wifi/wifi_dhcp.yaml` were near-identical copies of the same block,
and every device carried `ip_address`/`ip_subnet`/`ip_gateway`
substitutions whether or not it used them.
Devices now include exactly one combo package, which is nothing but a
`packages:` block pulling in one common, one chip and one network layer.
Adding an ethernet board is a two-line file rather than a fork of the
core.
Changes:
- Split `device_base.yaml` into `device_common.yaml` (chip- and
network-agnostic core), `device_esp32.yaml` / `device_esp8266.yaml`
(platform block only), and `device_wifi.yaml` / `device_eth.yaml`
(network stack plus its own diagnostics).
- Add the combo packages devices actually include:
`device_esp32_wifi.yaml`, `device_esp8266_wifi.yaml`,
`device_esp32_eth.yaml`. There is no esp8266+eth combo -- no such
device exists here.
- Add `text_sensor/ethernet_info.yaml` for the eth layer's IP-address
diagnostic, mirroring `text_sensor/wifi_info.yaml`. The `ethernet:`
block itself stays in the device yaml, since PHY/pin wiring is
board-specific.
- Drop `wifi/wifi_dhcp.yaml` and collapse `wifi/wifi.yaml` to the DHCP
form. Static IPs are handled by DHCP reservations on the router, so
the `manual_ip:` variant and its substitutions are gone. `wifi.yaml`
now sources `wifi_ssid`/`wifi_password` itself instead of relying on
`device_common.yaml` to define them for it.
- Rename `econet_base.yaml` to `econet.yaml` and repoint it at
`device_esp32_wifi.yaml`; rename every device's `device_base:`
package key to `device:`, now that it names a combo rather than a base.
- Drop the OTA and AP passwords (`password: ${pwd}` in `ota/ota.yaml`
and `wifi/wifi.yaml`) along with `ap_timeout`. **This changes
behaviour on upgrade:** the first OTA push to each device must still
use the old password (the running firmware enforces it), but every
push after that is unauthenticated, as is the fallback AP. The
per-device `pwd:` substitutions are left in the device yamls for now
but are no longer referenced by anything.
- Widen the CI build-cache key from `device_base*.yaml` to
`device_*.yaml` so it still hashes the renamed files.
- bt-proxy-basement: drop `connection_slots` from 4 to 3.
- Add `.claude/settings.json` denying reads of `devices/secrets.yaml`.
- Update CLAUDE.md for the new package layout, and document that Bash
filesystem commands must be scoped -- `devices/.esphome/` holds ~38k
toolchain files on an SMB share, and Bash doesn't honour .gitignore
the way Grep/Glob do.
Verified with `pre-commit run --all-files` clean and `esphome config` on
bt-proxy-basement (esp32+wifi), master-bed (esp8266+wifi),
network-equipment (topgreener package) and hvac (econet package).
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
`external_components: source: github://pr#17849` tracks the head of upstream's pzem6l24 PR. That PR merged on 2026-09-27, and on 2026-09-23 it picked up `automation.register_apply_action` for its `reset_energy` action (esphome/esphome#19469). That helper merged into dev *after* the 2026.9 branch cut, so it is in no released ESPHome -- every `esphome config`/`compile` of pool.yaml against 2026.9.1 now dies with `module 'esphome.automation' has no attribute 'register_apply_action'`, which took CI's `esphome config` and `compile pool` jobs down with it. Tracking a PR head was always going to break the moment that head moved past the installed release. The goal here is compatibility with a *released* ESPHome, not dev, so pin the ref instead of chasing it. Changes: - Pin the pzem6l24 source to esphome/esphome at `36d39416f0a7cdabb536d5a7434222de462c3e89` -- the last commit on that PR before the `register_apply_action` switch, still on the stable `automation.register_action`. The `github://pr#N` shorthand accepts no ref (`validate_source_shorthand` only parses `@ref` for the `user/repo` form), so this uses the explicit `type: git` source. - Change `refresh: 1h` to `refresh: never`: a pinned SHA is immutable, so re-fetching it hourly only costs time. - Comment the pin with why it exists and when it can be dropped, so it gets removed once a release carries `register_apply_action` rather than silently freezing the component forever. Verified with `esphome config pool.yaml` locally (valid, and the pinned SHA fetches fine -- GitHub serves reachable commits by id). Co-authored-by: Claude Opus 5 <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.
device_base.yamlmixed three unrelated concerns into one file: the chip-agnostic core (api, ota, logger, diagnostics, time), and wifi — both thewifi:block itself and the wifi-only diagnostics (signal sensor, wifi-info text sensor). Because wifi was baked into the core, there was no way to build an ethernet device without either duplicating the whole core or including a wifi stack the board doesn't have. The static-IP/DHCP split made it worse:wifi/wifi.yamlandwifi/wifi_dhcp.yamlwere near-identical copies of the same block, and every device carriedip_address/ip_subnet/ip_gatewaysubstitutions whether or not it used them.Devices now include exactly one combo package, which is nothing but a
packages:block pulling in one common, one chip and one network layer. Adding an ethernet board is a two-line file rather than a fork of the core.Changes:
device_base.yamlintodevice_common.yaml(chip- and network-agnostic core),device_esp32.yaml/device_esp8266.yaml(platform block only), anddevice_wifi.yaml/device_eth.yaml(network stack plus its own diagnostics).device_esp32_wifi.yaml,device_esp8266_wifi.yaml,device_esp32_eth.yaml. There is no esp8266+eth combo — no such device exists here.text_sensor/ethernet_info.yamlfor the eth layer's IP-address diagnostic, mirroringtext_sensor/wifi_info.yaml. Theethernet:block itself stays in the device yaml, since PHY/pin wiring is board-specific.wifi/wifi_dhcp.yamland collapsewifi/wifi.yamlto the DHCP form. Static IPs are handled by DHCP reservations on the router, so themanual_ip:variant and its substitutions are gone.wifi.yamlnow sourceswifi_ssid/wifi_passworditself instead of relying ondevice_common.yamlto define them for it.econet_base.yamltoeconet.yamland repoint it atdevice_esp32_wifi.yaml; rename every device'sdevice_base:package key todevice:, now that it names a combo rather than a base.password: ${pwd}inota/ota.yamlandwifi/wifi.yaml) along withap_timeout. This changes behaviour on upgrade: the first OTA push to each device must still use the old password (the running firmware enforces it), but every push after that is unauthenticated, as is the fallback AP. The per-devicepwd:substitutions are left in the device yamls for now but are no longer referenced by anything.device_base*.yamltodevice_*.yamlso it still hashes the renamed files.connection_slotsfrom 4 to 3..claude/settings.jsondenying reads ofdevices/secrets.yaml.external_componentssource to esphome/esphome at36d39416f0a7withrefresh: never, instead of trackinggithub://pr#17849. The PR head moved toautomation.register_apply_actionon 2026-09-23 ([core][cover] Add register_apply_action for actions that only forward values esphome/esphome#19469), which landed after the 2026.9 branch cut and so exists in no released ESPHome — it took CI'sesphome configandcompile pooldown with it.36d39416f0a7is the last commit on that PR still using the stableautomation.register_action. Thegithub://pr#Nshorthand accepts no@ref, hence the explicittype: gitsource. The pin is commented with when to drop it.devices/.esphome/holds ~38k toolchain files on an SMB share, and Bash doesn't honour.gitignorethe way Grep/Glob do.Follows on from #92, which parked the pool display stack.
Verified with
pre-commit run --all-filesclean andesphome configon bt-proxy-basement (esp32+wifi), master-bed (esp8266+wifi), network-equipment (topgreener package) and hvac (econet package); CI validates all of them plus the five compiles.🤖 Generated with Claude Code