Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 2.07 KB

File metadata and controls

22 lines (14 loc) · 2.07 KB

CLAUDE.md — Levoit ESPHome firmware

Project overview lives in README.md: custom ESPHome firmware + external component for Levoit air purifiers. Per-device YAML under devices/<device>/.

Per-device credential discipline

Based on /opt/autocoder/CREDENTIAL_CONVENTIONS_TEMPLATE.md (canonical), adapted for this repo.

Each flashable device has its own devices/<device>/secrets.yaml holding wifi_ssid, wifi_password, wifi_ap_password, ota_password, and api_key. These files are per-device, gitignored, and must be mode 0600 (each devices/<device>/ directory has its own .gitignore containing /secrets.yaml; the root .gitignore covers secret.yaml and components/secrets.yaml but does not match devices/<device>/secrets.yaml — so the per-device .gitignore is what actually protects the secrets file. Only the chmod protects against local read by other users).

Workflow when onboarding a new device:

  1. For a brand-new device directory, create devices/<device>/.gitignore containing /secrets.yaml before anything else — the root .gitignore will not cover the secrets file otherwise.
  2. Copy devices/<device>/secrets-example.yaml to devices/<device>/secrets.yaml.
  3. Fill in the five fields with values from David's IoT VLAN credential store.
  4. chmod 600 devices/<device>/secrets.yaml.
  5. Verify with ls -la devices/<device>/secrets.yaml — must show -rw-------.
  6. esphome run devices/<device>/<device>.yaml to flash.

The YAML files reference these values via ESPHome's !secret indirection (api_key: !secret api_key, etc.) — never inline a literal. Rotation = re-flash; the device must be physically reachable, so rotation is per-device and event-driven, not scheduled. Central rotation runbook: /opt/autocoder/ROTATION_RUNBOOK.md ("Levoit device creds" row).

Conventions for credentialed work in this session. Never cat, echo, or otherwise render secrets.yaml content to stdout. ESPHome reads it directly; verify success via esphome run output (device booting, Wi-Fi connecting), not by reading the file back.