Skip to content

Commit 80f99a5

Browse files
authored
Merge pull request #6110 from esphome/bump-2026.2.0b4
2026.2.0b4
2 parents 84ad5ec + aac346d commit 80f99a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+326
-2336
lines changed

.devcontainer/postCreate.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ updates:
55
schedule:
66
interval: daily
77
open-pull-requests-limit: 10
8-
- package-ecosystem: pip
8+
- package-ecosystem: npm
99
directory: "/"
1010
schedule:
1111
interval: daily

.github/workflows/docker.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.gitpod.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ports:
2-
- port: 8000
2+
- port: 4321
33
onOpen: open-preview
44

55
tasks:
6-
- command: make live-html
6+
- init: npm install
7+
command: npm run dev

.vscode/tasks.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "Live HTML build",
5+
"label": "Dev server",
66
"type": "shell",
7-
"command": "make live-html",
7+
"command": "npm run dev",
88
"problemMatcher": []
9-
},
9+
}
1010
]
1111
}

Dockerfile

Lines changed: 0 additions & 44 deletions
This file was deleted.

assets

Lines changed: 0 additions & 1 deletion
This file was deleted.

astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ export default defineConfig({
168168
editLink: {
169169
baseUrl: "https://github.com/esphome/esphome-docs/edit/current/",
170170
},
171+
routeMiddleware: ["./src/routeData.ts"],
171172
components: {
172173
Footer: "./src/components/Footer.astro",
173174
},

data/version.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
release: 2026.2.0b3
1+
release: 2026.2.0b4
22
version: '2026.2'

lint.mjs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,62 @@ async function checkInternalLinks(fname, content, anchorCache) {
364364
}
365365
}
366366

367+
function checkAutomationHeadings(fname, content) {
368+
if (!fname.startsWith('src/content/docs/components/')) return;
369+
if (!fname.endsWith('.md') && !fname.endsWith('.mdx')) return;
370+
371+
// Skip the main actions page which documents core actions (delay, if, lambda, etc.)
372+
if (fname.includes('automations/')) return;
373+
374+
const lines = content.split('\n');
375+
for (let i = 0; i < lines.length; i++) {
376+
const line = lines[i];
377+
const lineno = i + 1;
378+
379+
// Only look at heading lines
380+
if (!line.match(/^#{2,4}\s/)) continue;
381+
382+
// Check 1: Backticked `domain.name` without Action/Condition/Trigger suffix
383+
// e.g. ### `wireguard.enabled`
384+
if (line.match(/^#{2,4}\s+`[a-z_][a-z0-9_.]*\.[a-z_][a-z0-9_]*`\s*$/)) {
385+
addError(fname, lineno, 1,
386+
'Heading has backticked automation name but is missing Action/Condition/Trigger suffix. ' +
387+
'Add " Action", " Condition", or " Trigger" after the closing backtick.');
388+
}
389+
390+
// Check 2: Action/Condition with backticked name missing domain prefix (no dot)
391+
// e.g. ### `arm_away` Action
392+
const noDotMatch = line.match(/^#{2,4}\s+`([a-z_][a-z0-9_]*)`\s+(?:Action|Condition)s?\s*$/i);
393+
if (noDotMatch) {
394+
const name = noDotMatch[1];
395+
// Exclude core actions/conditions documented on actions.mdx
396+
const coreNames = [
397+
'delay', 'if', 'lambda', 'repeat', 'wait_until', 'while',
398+
'and', 'all', 'or', 'any', 'xor', 'not', 'for',
399+
];
400+
if (!coreNames.includes(name) && !name.startsWith('on_')) {
401+
addError(fname, lineno, 1,
402+
`Heading "\`${name}\`" is missing the domain prefix. ` +
403+
'Use the format: `domain.name` Action/Condition (e.g. `switch.toggle` Action).');
404+
}
405+
}
406+
407+
// Check 3: Bold **Action** or **Condition** suffix
408+
// e.g. ### `remote_transmitter.transmit_nec` **Action**
409+
if (line.match(/^#{2,4}\s+`[^`]+`.*\*\*(?:Action|Condition)s?\*\*/)) {
410+
addError(fname, lineno, 1,
411+
'Action/Condition suffix should not be bold. Use plain text: " Action" or " Condition".');
412+
}
413+
414+
// Check 4: Lowercase action/condition suffix (not matching standard capitalization)
415+
// e.g. ### `sprinkler.start_full_cycle` action
416+
if (line.match(/^#{2,4}\s+`[a-z_][a-z0-9_.]*\.[a-z_][a-z0-9_]*`\s+(?:action|condition)s?\s*$/)) {
417+
addError(fname, lineno, 1,
418+
'Action/Condition suffix should be capitalized. Use "Action" or "Condition" (not lowercase).');
419+
}
420+
}
421+
}
422+
367423
// Main execution
368424
async function main() {
369425
console.log(`${colors.cyan}Running ESPHome documentation linter...${colors.reset}\n`);
@@ -410,6 +466,7 @@ async function main() {
410466
checkNewlines(fname, content);
411467
checkEndNewline(fname, content);
412468
checkEsphomeLinks(fname, content);
469+
checkAutomationHeadings(fname, content);
413470
await checkInternalLinks(fname, content, anchorCache);
414471

415472
} catch (error) {

0 commit comments

Comments
 (0)