Skip to content

Commit 99dea2d

Browse files
committed
chore: restructure
1 parent 48864be commit 99dea2d

31 files changed

+363
-508
lines changed

.github/workflows/lint.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
name: Lint
3+
4+
on:
5+
push:
6+
paths:
7+
- "**/*.yaml"
8+
- ".github/workflows/lint.yaml"
9+
pull_request:
10+
paths:
11+
- "**/*.yaml"
12+
- ".github/workflows/lint.yaml"
13+
14+
jobs:
15+
list-configs:
16+
name: Discover ESPHome configs
17+
runs-on: ubuntu-latest
18+
outputs:
19+
configs: ${{ steps.collect.outputs.configs }}
20+
steps:
21+
- name: Check out repository
22+
uses: actions/checkout@v4
23+
24+
- name: Collect config files
25+
id: collect
26+
run: |
27+
python <<'PY'
28+
import json
29+
import os
30+
from pathlib import Path
31+
32+
configs = sorted(
33+
str(path.name)
34+
for path in Path(".").glob("*.yaml")
35+
if path.name != "secrets.yaml"
36+
)
37+
38+
if not configs:
39+
raise SystemExit("No ESPHome configs found in the repository root.")
40+
41+
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as fh:
42+
fh.write(f"configs={json.dumps(configs)}\n")
43+
PY
44+
45+
esphome-config:
46+
name: Validate ${{ matrix.config }}
47+
runs-on: ubuntu-latest
48+
needs: list-configs
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
config: ${{ fromJson(needs.list-configs.outputs.configs) }}
53+
steps:
54+
- name: Check out repository
55+
uses: actions/checkout@v4
56+
57+
- name: Set up Python
58+
uses: actions/setup-python@v5
59+
with:
60+
python-version: "3.13"
61+
cache: pip
62+
- run: pip install esphome
63+
64+
- name: Provide stub secrets.yaml
65+
run: |
66+
cat <<'EOF' > secrets.yaml
67+
wifi_ssid: "dummy-ssid"
68+
wifi_password: "dummy-password"
69+
api_key: "dummy-api-key"
70+
ota_password: "dummy-ota-password"
71+
EOF
72+
73+
- name: Run esphome config
74+
run: esphome config "${{ matrix.config }}"

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
.DS_Store
1+
lost+found
2+
.code-server/
3+
.ash_history
4+
.esphome/
25

6+
#ESPHome ignores
37
/secrets.yaml

.lefthook.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[pre-commit]
2+
parallel = true
3+
4+
[pre-commit.commands.format-yaml]
5+
run = "yamlfmt {staged_files}"
6+
glob = ["*.yaml"]
7+
stage_fixed = true

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"esphome.esphome-vscode"
4+
]
5+
}

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"*.yaml": "esphome"
4+
}
5+
}

.yamlfmt.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
---
22
doublestar: true
3-
exclude:
4-
- "**/*.sops.yaml"
53
formatter:
64
type: basic
75
disable_alias_key_correction: true

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
# esphome-configs
1+
# esphome-config
2+
3+
Some ESPHome configurations, based on [bjw-s-labs/esphome-config](https://github.com/bjw-s-labs/esphome-config).

alexs-bedroom-bluetooth-proxy.yaml

Lines changed: 9 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,14 @@
11
---
2-
# settings
3-
esphome:
4-
name: alexs-bedroom-bluetooth-proxy
5-
friendly_name: "Alex's Bedroom Bluetooth Proxy"
2+
substitutions:
3+
system_name: alexs-bedroom-bluetooth-proxy
4+
friendly_name: Alex's Bedroom Bluetooth Proxy
5+
device_description: M5Stack AtomS3 Bluetooth proxy
66

77
esp32:
88
board: m5stack-atoms3
9-
variant: esp32s3
10-
framework:
11-
type: esp-idf
129

13-
wifi:
14-
ssid: !secret wifi_ssid
15-
password: !secret wifi_password
16-
use_address: "192.168.2.171"
17-
domain: ".iot"
18-
on_connect:
19-
then:
20-
- light.turn_on:
21-
id: status_led
22-
red: 0%
23-
green: 100%
24-
blue: 0%
25-
brightness: 100%
26-
effect: none
27-
28-
logger:
29-
30-
api:
31-
encryption:
32-
key: !secret api_key
33-
34-
ota:
35-
- platform: esphome
36-
password: !secret ota_password
37-
38-
# configuration
39-
light:
40-
- platform: esp32_rmt_led_strip
41-
id: status_led
42-
chipset: WS2812
43-
pin: 35
44-
num_leds: 1
45-
rgb_order: GRB
46-
internal: true
47-
48-
bluetooth_proxy:
49-
active: true
50-
51-
esp32_ble_tracker:
52-
scan_parameters:
53-
interval: 320ms
54-
window: 320ms
55-
active: false
10+
packages:
11+
device: !include
12+
file: esp32/base.yaml
13+
bluetooth-proxy: !include
14+
file: esphome-common/bluetooth-proxy.yaml

attic-bluetooth-proxy.yaml

Lines changed: 9 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,14 @@
11
---
2-
# settings
3-
esphome:
4-
name: attic-bluetooth-proxy
5-
friendly_name: "Attic Bluetooth Proxy"
2+
substitutions:
3+
system_name: attic-bluetooth-proxy
4+
friendly_name: Attic Bluetooth Proxy
5+
device_description: M5Stack AtomS3 Bluetooth proxy
66

77
esp32:
88
board: m5stack-atoms3
9-
variant: esp32s3
10-
framework:
11-
type: esp-idf
129

13-
wifi:
14-
ssid: !secret wifi_ssid
15-
password: !secret wifi_password
16-
use_address: "192.168.2.120"
17-
domain: ".iot"
18-
on_connect:
19-
then:
20-
- light.turn_on:
21-
id: status_led
22-
red: 0%
23-
green: 100%
24-
blue: 0%
25-
brightness: 100%
26-
effect: none
27-
28-
logger:
29-
30-
api:
31-
encryption:
32-
key: !secret api_key
33-
34-
ota:
35-
- platform: esphome
36-
password: !secret ota_password
37-
38-
# configuration
39-
light:
40-
- platform: esp32_rmt_led_strip
41-
id: status_led
42-
chipset: WS2812
43-
pin: 35
44-
num_leds: 1
45-
rgb_order: GRB
46-
internal: true
47-
48-
bluetooth_proxy:
49-
active: true
50-
51-
esp32_ble_tracker:
52-
scan_parameters:
53-
interval: 320ms
54-
window: 320ms
55-
active: false
10+
packages:
11+
device: !include
12+
file: esp32/base.yaml
13+
bluetooth-proxy: !include
14+
file: esphome-common/bluetooth-proxy.yaml

carport-door-opener.yaml

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,21 @@
11
---
2-
# settings
3-
esphome:
4-
name: carport-door-opener
2+
substitutions:
3+
system_name: carport-door-opener
54
friendly_name: "Carport Door Opener"
5+
device_description: NodeMCU-based garage door controller
66

77
esp8266:
8-
board: nodemcuv2
98
restore_from_flash: true
109

11-
wifi:
12-
ssid: !secret wifi_ssid
13-
password: !secret wifi_password
14-
use_address: "192.168.2.77"
15-
domain: ".iot"
16-
17-
logger:
18-
19-
api:
20-
encryption:
21-
key: !secret api_key
22-
23-
ota:
24-
- platform: esphome
25-
password: !secret ota_password
26-
27-
sensor:
28-
- platform: wifi_signal
29-
name: "WiFi Signal dB"
30-
id: wifi_signal_db
31-
update_interval: 60s
32-
entity_category: "diagnostic"
10+
packages:
11+
device: !include
12+
file: esp8266/base.yaml
3313

3414
# configuration
3515
globals:
3616
- id: performing_last_movement
3717
type: boolean
38-
restore_value: no
18+
restore_value: false
3919
initial_value: "false"
4020

4121
switch:

0 commit comments

Comments
 (0)