Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Static site, **no build step** — do not add bundlers, frameworks, or npm deps
- Validate registry: `python scripts/validate_registry.py` (network, ~15s); `--offline` for the shape checks alone.
- `devices.json` is the single source of truth; views, scripts, and tests all read it. Device ids are lowercase-kebab and become URL hashes (`#/air-1`) and image filenames.
- Every device needs `id`, `name`, `category` (hub filter pill), `description`, `image`, `wiki`, `repo`, and `firmware` (`channel -> variant -> manifest URL`), and normally `imageSource` (input to `fetch_images.py`) and `githubPagesInstaller`. `stable` is required and preferred; the first variant key is the default selection. Manifests must live on the variant's own repo's GitHub Pages site and be one of the builds that repo's classic installer page offers (the validator checks both, and that no two variants share a manifest; it can't catch two of the page's builds swapped between variants, so check the mapping by hand). Optional `config` has the same shape as `firmware` and points at the raw YAML that builds each manifest.
- Per-variant overrides in `devices.json` all follow one shape: `channel -> variant -> value`, listing only the variants that differ from the device-level field. `repos` overrides `repo`, `installers` overrides `githubPagesInstaller` (`null` hides the link), `platforms` overrides `platform`, which selects the step-3 wording: `esphome` (default), `wled`, `gameday` (the M-1's Game Day Scoreboard: Wi-Fi, then pick a team on the panel's own device page), or `standalone` (no network at all, e.g. the ornaments' Basic firmware: step 3 says there is nothing to add). `variantNotes` is the same shape but adds rather than overrides: a sentence or two under the variant toggle saying when to pick that variant. The device-level field stays the fallback, so a device that ships one ecosystem today needs no map.
- Per-variant overrides in `devices.json` all follow one shape: `channel -> variant -> value`, listing only the variants that differ from the device-level field. `repos` overrides `repo`, `installers` overrides `githubPagesInstaller` (`null` hides the link), `platforms` overrides `platform`, which selects the step-3 wording: `esphome` (default), `wled`, `gameday` (the M-1's Game Day Scoreboard: Wi-Fi, then pick a team on the panel's own device page), or `standalone` (no network at all, e.g. the ornaments' Basic firmware: step 3 says there is nothing to add). The `wled` copy's setup hotspot defaults to `Apollo <name>`; a board whose SSID or setup differs (the MLED-1's `Apollo MLED-1 Hotspot`, the M-1's on-panel setup card) gets an entry in `WLED_SETUP` in `js/views/device.js`. `variantNotes` is the same shape but adds rather than overrides: a sentence or two under the variant toggle saying when to pick that variant. The device-level field stays the fallback, so a device that ships one ecosystem today needs no map.
- **Deploy gotcha:** `.github/workflows/pages.yml` copies an explicit file list into `_site/`. Any new runtime file or directory must be added there or it 404s in production while working locally.
- `vendor/esp-web-tools/` is a pinned upstream copy — never hand-edit.
- Security stance: registry fields are trusted repo content (`description` and `variantNotes` are rendered as HTML); runtime-fetched content (GitHub releases, manifest-derived URLs and filenames, the URL hash) must be escaped with `esc()` or set via `textContent`, and manifest part URLs are parsed with `URL` and limited to https (see `js/views/device.js`).
Expand Down
17 changes: 17 additions & 0 deletions devices.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,23 @@
}
}
},
{
"id": "mled-1",
"name": "MLED-1",
"category": "LED controller",
"description": "Mini WLED controller for addressable LED strips: 5V 3A, one WAGO output",
"image": "images/mled-1.jpg",
"imageSource": "https://cdn.shopify.com/s/files/1/0792/0959/5187/files/20261102_165108.jpg?v=1793665448&height=600&crop=center",
"wiki": "https://wiki.apolloautomation.com/products/mled1/introduction/",
"platform": "wled",
"repo": "ApolloAutomation/MLED-1",
"githubPagesInstaller": "https://apolloautomation.github.io/MLED-1/",
"firmware": {
"stable": {
"WLED": "https://apolloautomation.github.io/MLED-1/firmware/manifest.json"
}
}
},
{
"id": "h-1",
"name": "H-1",
Expand Down
Binary file added images/mled-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 19 additions & 3 deletions js/views/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ function platformFor(device, channel, variant) {
return device.platform || 'esphome';
}

// WLED setup that differs per board; default hotspot is "Apollo <name>".
const WLED_SETUP = {
'm-1': {
extra: 'On 16.0.1 the panel itself shows a setup card with that address and a QR code.',
},
'mled-1': {
hotspot: 'Apollo MLED-1 Hotspot',
// Shown before the Home Assistant step.
strip: `Once it is on your Wi-Fi, set it up for your strip: open its web UI at the device's IP
address, or use the WLED mobile app, and under <strong>Config → LED &amp; Hardware</strong> set
the LED type, color order and number of LEDs to match. The strip's data line is on GPIO 13.`,
},
};

// Step 3 differs by what the firmware does once installed: ESPHome devices are
// adopted through the ESPHome integration and Device Builder, WLED devices through
// the WLED integration and the WLED web UI, the Game Day Scoreboard is set up on
Expand Down Expand Up @@ -128,11 +142,13 @@ function stepThreeHtml(device, platform) {
}
const heading = '<h2><span class="num">3</span> Add to Home Assistant</h2>';
if (platform === 'wled') {
const setup = WLED_SETUP[device.id] || {};
return heading + `
<p>If you did not set Wi-Fi during install, join the open
<strong>Apollo ${device.name}</strong> Wi-Fi hotspot the device broadcasts, then open
<code>4.3.2.1</code> in a browser and pick your network. On 16.0.1 the panel itself
shows a setup card with that address and a QR code. Once it is on your Wi-Fi, go to
<strong>${setup.hotspot || `Apollo ${device.name}`}</strong> Wi-Fi hotspot the device broadcasts, then open
<code>4.3.2.1</code> in a browser and pick your network.${setup.extra ? ` ${setup.extra}` : ''}${setup.strip ? `</p>
<p>${setup.strip}</p>
<p>Then go to` : ' Once it is on your Wi-Fi, go to'}
<strong>Settings → Devices &amp; services</strong> in Home Assistant, where it appears as a
discovered <strong>WLED</strong> device. Click <strong>Configure</strong>, and you're done.
<span class="done-check">✓</span></p>
Expand Down
26 changes: 26 additions & 0 deletions tests/installer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,32 @@ test('step 3 gives WLED instructions on a WLED device, not ESPHome ones', async
await expect(done).not.toContainText('dashboard_import');
});

test('step 3 names each WLED board\'s own hotspot and keeps the setup card M-1-only', async ({ page }) => {
const m1 = registry.devices.find((x) => x.id === 'm-1');
const mled = registry.devices.find((x) => x.id === 'mled-1');
test.skip(!m1 || !mled, 'needs m-1 and mled-1 in registry');

await page.goto('/#/m-1');
const done = page.locator('#step-done');
await expect(done.locator('strong').first()).toHaveText('Apollo M-1');
await expect(done).toContainText('setup card with that address and a QR code');
await expect(done).not.toContainText('GPIO');

await page.goto('/#/mled-1');
await expect(done).toContainText('4.3.2.1');
await expect(done.locator('strong').first()).toHaveText('Apollo MLED-1 Hotspot');
// No display, so no setup card or QR code.
await expect(done).not.toContainText('setup card');
await expect(done).not.toContainText('QR');
await expect(done).toContainText('LED & Hardware');
await expect(done).toContainText('GPIO 13');
await expect(done).toContainText('discovered');
// LED setup comes before "you're done".
const text = await done.innerText();
expect(text.indexOf('LED & Hardware')).toBeLessThan(text.indexOf("you're done"));
await expect(done).not.toContainText('Take control');
});

test('step 3 walks a Game Day Scoreboard install through Wi-Fi and picking a team', async ({ page }) => {
const d = registry.devices.find((x) => x.platforms && x.platforms.stable
&& Object.values(x.platforms.stable).includes('gameday'));
Expand Down
Loading