Skip to content

Commit 2b519e7

Browse files
authored
New repository format (#55)
1 parent 631a6ae commit 2b519e7

19 files changed

+774
-179
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,41 @@
11
name: Build
22

33
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
48
workflow_dispatch:
9+
release:
10+
types: [published]
511

6-
jobs:
7-
build:
8-
name: Build ${{ matrix.firmware.name }}
9-
runs-on: ubuntu-latest
10-
strategy:
11-
matrix:
12-
firmware:
13-
- file: m5stack-atom-echo.yaml
14-
name: M5 Stack Atom Echo
15-
manifest_filename: m5stack-atom-echo-manifest.json
16-
- file: m5stack-atom-speaker-kit.yaml
17-
name: M5 Stack Atom Speaker Kit
18-
manifest_filename: m5stack-atom-speaker-kit-manifest.json
19-
- file: raspiaudio-muse-proto.yaml
20-
name: Raspiaudio Muse Proto
21-
manifest_filename: raspiaudio-muse-proto-manifest.json
22-
- file: raspiaudio-muse-luxe.yaml
23-
name: Raspiaudio Muse Luxe
24-
manifest_filename: raspiaudio-muse-luxe-manifest.json
25-
fail-fast: false
26-
steps:
27-
- name: Checkout source code
28-
uses: actions/[email protected]
29-
- name: Build firmware
30-
uses: esphome/[email protected]
31-
id: esphome-build
32-
with:
33-
yaml_file: ${{ matrix.firmware.file }}
34-
version: latest
35-
- name: Copy firmware and manifest
36-
run: |
37-
mkdir output
38-
mv ${{ steps.esphome-build.outputs.name }} output/
39-
jq -s '{"name": "${{ matrix.firmware.name }}", "version": "${{ steps.esphome-build.outputs.esphome-version }}", "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":.}' output/${{ steps.esphome-build.outputs.name }}/manifest.json > output/${{ matrix.firmware.manifest_filename }}
40-
41-
- name: Upload artifact
42-
uses: actions/[email protected]
43-
with:
44-
name: ${{ matrix.firmware.name }}
45-
path: output
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
4615

16+
jobs:
17+
build-firmware:
18+
name: Build Firmware
19+
uses: esphome/workflows/.github/workflows/build.yml@main
20+
with:
21+
files: |
22+
m5stack/m5stack-atom-echo.factory.yaml
23+
m5stack/m5stack-atom-speaker-kit.factory.yaml
24+
onju-voice/onju-voice.factory.yaml
25+
raspiaudio/raspiaudio-muse-luxe.factory.yaml
26+
raspiaudio/raspiaudio-muse-proto.factory.yaml
27+
esphome-version: 2024.7.3
28+
release-summary: ${{ github.event_name == 'release' && github.event.release.body || '' }}
29+
release-url: ${{ github.event_name == 'release' && github.event.release.html_url || '' }}
30+
release-version: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }}
4731

48-
consolidate:
49-
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main'
50-
name: Consolidate firmwares
51-
runs-on: ubuntu-latest
52-
needs: build
53-
steps:
54-
- name: Checkout source code
55-
uses: actions/checkout@v3
56-
- name: Download built firmwares
57-
uses: actions/download-artifact@v3
58-
with:
59-
path: firmwares
60-
- name: Copy files
61-
run: |-
62-
mkdir output
63-
cp -R static/* output/
64-
cp -R firmwares/*/* output/
65-
- name: Upload GitHub Pages artifact
66-
uses: actions/[email protected]
67-
with:
68-
path: output
69-
70-
deploy:
71-
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main'
72-
name: Deploy to GitHub Pages
73-
runs-on: ubuntu-latest
74-
needs: consolidate
75-
permissions:
76-
pages: write
77-
id-token: write
78-
environment:
79-
name: github-pages
80-
url: ${{ steps.deployment.outputs.page_url }}
81-
steps:
82-
- name: Setup Pages
83-
uses: actions/configure-pages@v2
84-
- name: Deploy to GitHub Pages
85-
id: deployment
86-
uses: actions/[email protected]
32+
upload:
33+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
34+
name: Upload to R2
35+
needs:
36+
- build-firmware
37+
uses: esphome/workflows/.github/workflows/upload.yml@main
38+
with:
39+
name: wake-word-voice-assistant
40+
version: ${{ needs.build-firmware.outputs.version }}
41+
secrets: inherit

.github/workflows/yaml-lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: YAML lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "**.yaml"
8+
- "**.yml"
9+
pull_request:
10+
paths:
11+
- "**.yaml"
12+
- "**.yml"
13+
14+
jobs:
15+
yamllint:
16+
name: 🧹 yamllint
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: ⤵️ Check out configuration from GitHub
20+
uses: actions/[email protected]
21+
- name: 🚀 Run yamllint
22+
run: yamllint --strict .

.yamllint

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
extends: default
3+
4+
ignore-from-file: .gitignore
5+
6+
rules:
7+
document-start: disable
8+
empty-lines:
9+
level: error
10+
max: 1
11+
max-start: 0
12+
max-end: 1
13+
indentation:
14+
level: error
15+
spaces: 2
16+
indent-sequences: true
17+
check-multi-line-strings: false
18+
line-length: disable
19+
truthy: disable

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# This repository is deprecated
2-
3-
We have copied the source files to https://github.com/esphome/firmware/tree/main/media-player and the firmware is generated there.
4-
51
# ESPHome Media Players
62

7-
This repo hosts known, tested devices that can server as media players to Home Assistant.
3+
This repo hosts known, tested devices that can serve as media players to Home Assistant.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
packages:
2+
m5stack-atom-echo: !include m5stack-atom-echo.yaml
3+
4+
esphome:
5+
project:
6+
name: m5stack.atom-echo
7+
version: dev
8+
9+
ota:
10+
- platform: http_request
11+
id: ota_http_request
12+
13+
update:
14+
- platform: http_request
15+
id: update_http_request
16+
name: Firmware
17+
source: https://firmware.esphome.io/media-player/m5stack-atom-echo/manifest.json
18+
19+
http_request:
20+
verify_ssl: false
21+
22+
dashboard_import:
23+
package_import_url: github://esphome/media-players/m5stack/m5stack-atom-echo.yaml@main
24+
25+
improv_serial:

m5stack-atom-echo.yaml renamed to m5stack/m5stack-atom-echo.yaml

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
substitutions:
2-
name: "m5stack-atom-echo"
3-
friendly_name: "M5Stack Atom Echo"
4-
wifi_ap_password: ""
5-
61
esphome:
7-
name: ${name}
8-
friendly_name: ${friendly_name}
2+
name: m5stack-atom-echo
3+
friendly_name: M5Stack Atom Echo
4+
min_version: 2024.6.0
95
name_add_mac_suffix: true
10-
project:
11-
name: m5stack.atom-echo
12-
version: "1.0"
13-
min_version: 2023.5.0
146

157
esp32:
168
board: m5stack-atom
@@ -19,22 +11,20 @@ esp32:
1911

2012
logger:
2113
api:
22-
ota:
2314

24-
dashboard_import:
25-
package_import_url: github://esphome/media-players/m5stack-atom-echo.yaml@main
15+
ota:
16+
- platform: esphome
17+
id: ota_esphome
2618

2719
wifi:
2820
ap:
29-
password: "${wifi_ap_password}"
3021

3122
captive_portal:
3223

33-
improv_serial:
34-
3524
i2s_audio:
36-
i2s_lrclk_pin: GPIO33
37-
i2s_bclk_pin: GPIO19
25+
- id: i2s_audio_bus
26+
i2s_lrclk_pin: GPIO33
27+
i2s_bclk_pin: GPIO19
3828

3929
microphone:
4030
- platform: i2s_audio
@@ -99,6 +89,11 @@ binary_sensor:
9989
- timing:
10090
- ON FOR AT LEAST 350ms
10191
then:
92+
- if:
93+
condition:
94+
media_player.is_playing: media_out
95+
then:
96+
- media_player.stop: media_out
10297
- voice_assistant.start:
10398
- timing:
10499
- ON FOR AT LEAST 350ms
@@ -128,3 +123,12 @@ light:
128123
- pulse:
129124
transition_length: 250ms
130125
update_interval: 250ms
126+
127+
button:
128+
- platform: safe_mode
129+
id: button_safe_mode
130+
name: Safe Mode Boot
131+
132+
- platform: factory_reset
133+
id: factory_reset_btn
134+
name: Factory reset
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
packages:
2+
m5stack-atom-speaker-kit: !include m5stack-atom-speaker-kit.yaml
3+
4+
esphome:
5+
project:
6+
name: m5stack.atom-speaker-kit
7+
version: dev
8+
9+
ota:
10+
- platform: http_request
11+
id: ota_http_request
12+
13+
update:
14+
- platform: http_request
15+
id: update_http_request
16+
name: Firmware
17+
source: https://firmware.esphome.io/media-player/m5stack-atom-speaker-kit/manifest.json
18+
19+
http_request:
20+
verify_ssl: false
21+
22+
dashboard_import:
23+
package_import_url: github://esphome/media-players/m5stack/m5stack-atom-speaker-kit.yaml@main
24+
25+
improv_serial:
Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
substitutions:
2-
name: "m5stack-atom-speaker-kit"
3-
friendly_name: "M5Stack Atom Speaker Kit"
4-
wifi_ap_password: ""
5-
61
esphome:
7-
name: ${name}
8-
friendly_name: ${friendly_name}
2+
name: m5stack-atom-speaker-kit
3+
friendly_name: M5Stack Atom Speaker Kit
4+
min_version: 2024.6.0
95
name_add_mac_suffix: true
10-
project:
11-
name: m5stack.atom-speaker-kit
12-
version: "1.0"
136

147
esp32:
158
board: m5stack-atom
@@ -18,21 +11,19 @@ esp32:
1811

1912
logger:
2013
api:
21-
ota:
2214

23-
dashboard_import:
24-
package_import_url: github://esphome/media-players/m5stack-atom-speaker-kit.yaml@main
15+
ota:
16+
- platform: esphome
17+
id: ota_esphome
2518

2619
wifi:
2720
ap:
28-
password: "${wifi_ap_password}"
2921

3022
captive_portal:
3123

32-
improv_serial:
33-
3424
i2s_audio:
35-
- i2s_lrclk_pin: GPIO21
25+
- id: i2s_audio_bus
26+
i2s_lrclk_pin: GPIO21
3627
i2s_bclk_pin: GPIO22
3728

3829
media_player:
@@ -48,14 +39,25 @@ binary_sensor:
4839
pin:
4940
number: GPIO39
5041
inverted: true
42+
id: top_button
5143
name: Button
5244
on_click:
5345
- media_player.toggle: media_out
5446

5547
light:
5648
- platform: fastled_clockless
49+
id: led
5750
name: None
5851
pin: GPIO27
5952
chipset: SK6812
6053
num_leds: 1
6154
rgb_order: grb
55+
56+
button:
57+
- platform: safe_mode
58+
id: button_safe_mode
59+
name: Safe Mode Boot
60+
61+
- platform: factory_reset
62+
id: factory_reset_btn
63+
name: Factory reset

onju-voice/onju-voice.factory.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
packages:
2+
onju-voice: !include onju-voice.yaml
3+
4+
esphome:
5+
project:
6+
name: onju.voice-assistant
7+
version: dev
8+
9+
ota:
10+
- platform: http_request
11+
id: ota_http_request
12+
13+
update:
14+
- platform: http_request
15+
id: update_http_request
16+
name: Firmware
17+
source: https://firmware.esphome.io/media-player/onju-voice/manifest.json
18+
19+
http_request:
20+
verify_ssl: false
21+
22+
dashboard_import:
23+
package_import_url: github://esphome/media-players/onju-voice/onju-voice.yaml@main
24+
25+
improv_serial:

0 commit comments

Comments
 (0)