Skip to content

Commit 02c9a52

Browse files
committed
chore: remove real identifiers from examples repo-wide
The screenshot fixtures were built by mirroring a live device to get the JSON field names right, which is how real values got into examples in the first place. A repo-wide sweep found more of the same predating that work: the rig's inverter model name in a tigo_web_server.cpp comment, two P4 test board configs, a curl example in the web-server guide, and a CHANGELOG example. Also removed the leaked CCA MAC from a comment in the new privacy test - documenting the leak by quoting it put it straight back in the repo. Only the boards/test-p4-*.yaml change has any effect: renaming those inverters changes the generated entity IDs for anyone building from those files. They are reference configs, not a deployed one. Claude-Session: https://claude.ai/code/session_01RgSnMCa3JQigphGnPbazdw
1 parent 8364952 commit 02c9a52

6 files changed

Lines changed: 11 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
159159
- **Panel modal showed "—" for Current in** — the `/api/devices` JSON field is named `"current"` (filled from `device.current_in`), not `"current_in"`; modal now reads the correct key. Duty cycle is already a percent in the JSON, so the suffix is now `%`.
160160
- **Panel modal card was transparent** because the CSS used `var(--bg-1)`, which isn't defined (`:root` defines `--bg`, `--bg-2`, `--bg-3`, `--bg-4`). Switched to `--bg-2`.
161161
- **Panel modal showed prior panel's history** during the in-flight fetch when reopening on a different panel — chart polylines now reset to empty + "…" placeholder on every open/range-change.
162-
- **YAML generator emitted redundant `tigo_mppt_mppt_4`-style IDs** when the user's label already started with the type tag. Generator now skips the type prefix when the slug already begins with it (so "MPPT 4" → `tigo_mppt_4`, "FlexBoss A" → `tigo_inverter_flexboss_a`).
162+
- **YAML generator emitted redundant `tigo_mppt_mppt_4`-style IDs** when the user's label already started with the type tag. Generator now skips the type prefix when the slug already begins with it (so "MPPT 4" → `tigo_mppt_4`, "South Roof" → `tigo_inverter_south_roof`).
163163
- **History wiped on every reboot** when using esp_tsdb (only with `feat/handle-based-api` fork). Root cause: `tsdb_open` used `stat()` to detect file existence, but joltwallet's `esp_littlefs` returns `ENOENT` from `stat()` for files that `fopen("rb")` immediately reads bytes back from. Every boot took the create-new path and `fopen("w+b")` truncated the existing file. Fix in the upstream PR (`zakery292/esp_tsdb#1`): try `fopen(..., "r+b")` first; fall through to create-new only on failure. Slot map (panel_map.json) was unaffected because it uses `open(wb)+write+close` per save, which never hits the bad code path.
164164
- **Nodes view crashed at active-sockets** during R5 diag-view rendering (fixed in `2f14ad8`).
165165
- **Persistence cleanup on shutdown**: `TigoMonitorComponent::on_shutdown` now drains the TSDB writer queue (best-effort, 800 ms cap), `tsdb_close_h`s every open handle, and unmounts LittleFS so the journal commits cleanly before `esp_restart`.

boards/test-p4-ble-tigomonitor.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ tigo_monitor:
141141
sync_cca_on_startup: false
142142
reset_at_midnight: true
143143
inverters:
144-
- name: "FlexBoss A"
144+
- name: "Inverter 1"
145145
mppts:
146146
- "MPPT 1"
147147
- "MPPT 2"
148-
- name: "FlexBoss B"
148+
- name: "Inverter 2"
149149
mppts:
150150
- "MPPT 3"
151151
- "MPPT 4"

boards/test-p4-tigomonitor.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ tigo_monitor:
142142
sync_cca_on_startup: false
143143
reset_at_midnight: true
144144
inverters:
145-
- name: "FlexBoss A"
145+
- name: "Inverter 1"
146146
mppts:
147147
- "MPPT 1"
148148
- "MPPT 2"
149-
- name: "FlexBoss B"
149+
- name: "Inverter 2"
150150
mppts:
151151
- "MPPT 3"
152152
- "MPPT 4"

components/tigo_server/tigo_web_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2929,7 +2929,7 @@ void TigoWebServer::build_yaml_json(PSRAMString& json, const std::set<std::strin
29292929

29302930
// Build "tigo_<type>_<slug>", but skip the <type> tag when the slug
29312931
// already starts with it (e.g. label "MPPT 4" -> "tigo_mppt_4", not
2932-
// "tigo_mppt_mppt_4"). Inverter "FlexBoss A" stays "tigo_inverter_flexboss_a".
2932+
// "tigo_mppt_mppt_4"). Inverter "South Roof" stays "tigo_inverter_south_roof".
29332933
auto make_id = [&slugify](const char *type_tag, const std::string &label) -> std::string {
29342934
std::string slug = slugify(label);
29352935
std::string tag(type_tag);

site/src/content/docs/guides/web-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Renaming an inverter:
221221
```bash
222222
curl -X POST http://192.168.1.100/api/inverters/rename \
223223
-H 'Content-Type: application/json' \
224-
-d '{"name":"FlexBoss A","display_name":"South Roof"}'
224+
-d '{"name":"Inverter 1","display_name":"South Roof"}'
225225
```
226226

227227
Setting per-panel nameplate watts on a string:

site/test/fixtures-privacy.test.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ test('MACs are inside the RFC 7042 documentation range', () => {
3737

3838
test('bare-hex identifiers use the reserved fake-serial shape', () => {
3939
// Prefix alone is NOT sufficient. The CCA MAC that leaked into the first
40-
// draft of these fixtures was 04C05BA1A94A — it starts with the public Tigo
41-
// OUI, so an OUI-only check waves real hardware straight through. Fake
42-
// serials must also carry the 0000 block, which no real unit has.
40+
// draft of these fixtures began with the public Tigo OUI itself, so an
41+
// OUI-only check waves real hardware straight through. Fake serials must
42+
// also carry the 0000 block, which no real unit has. (Deliberately not
43+
// quoting the leaked value here — that would put it back in the repo.)
4344
// Scan hex runs inside quoted values only. A bare /[0-9A-F]{10,}/ over the
4445
// whole blob also matches unquoted epoch timestamps — 1771136965 is ten
4546
// characters all of which are valid hex digits.

0 commit comments

Comments
 (0)