Skip to content

Name a plug while converting it, and record every conversion - #5

Merged
WiFiGUY512 merged 3 commits into
mainfrom
feat/name-at-convert
Nov 23, 2026
Merged

WiFiGUY512 merged 3 commits into
mainfrom
feat/name-at-convert

Conversation

@WiFiGUY512

Copy link
Copy Markdown
Owner

What changed

  • Name at conversion. convert asks for a name such as "Garage Freezer" (or takes --name). The plug boots as garage-freezer, shown as "Garage Freezer", with no second flash. Enter keeps sbplug-xxxxxx.
    • The portal and direct payloads carry two fixed-size placeholder slots (sbplug-name.yaml). A boot step before Wi-Fi reads them and uses them if they were filled in.
    • image.patch_name fills the slots and fixes the checksum and SHA-256, sharing the code path with the Wi-Fi patch.
    • It needs firmware from this release, and does not work through --server.
  • Adopt now imports sbplug-adopt.yaml, the portal firmware without the name slots.
  • Automatic log. Every converted plug is recorded in switchback-plugs.csv in the home folder. --log picks another file and --no-log turns it off.
  • Version 0.5.0, README, CHANGELOG, SECURITY note. CI validates the adopt config.

Checked

  • Both images build with ESPHome 2026.5.1 and fit: portal 988,432 bytes, direct 988,640 (limit 1,511,424).
  • Each marker appears once in each image. Patched images verify, including Wi-Fi and a name together.
  • pytest, ruff, ruff format and mypy pass.
  • On hardware: a patched build sent over the air to a converted plug booted as bench-test-plug / "Bench Test Plug", registered that hostname by DHCP, kept its Wi-Fi and entities, and stayed up past the rollback window.

Not yet tested

A full conversion of a stock plug with a name, and the hotspot name under a patched name.

🤖 Generated with Claude Code

WiFiGUY512 and others added 3 commits November 22, 2026 15:03
convert now appends each converted plug (time, name, both MACs) to
switchback-plugs.csv in the home folder. --log picks another file and
--no-log turns it off. A log that cannot be written no longer stops a
run. The README also says what label size --printer expects.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
convert asks for a name such as "Garage Freezer" (or takes --name) and
the plug boots as garage-freezer, with no second flash.

- sbplug-name.yaml: the portal and direct payloads carry two fixed-size
  placeholder slots. A boot step before Wi-Fi reads them and, if they
  were filled in, uses them as the name and friendly name.
- image.patch_name fills the slots and fixes the checksum and SHA-256,
  sharing the code path with the Wi-Fi patch.
- sbplug-adopt.yaml: what Adopt imports, without the name slots.
- Version 0.5.0, README, CHANGELOG, CI validates the adopt config.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@WiFiGUY512
WiFiGUY512 merged commit 204e6cd into main Nov 23, 2026
8 checks passed
@WiFiGUY512
WiFiGUY512 deleted the feat/name-at-convert branch November 23, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant