Skip to content

Commit

Permalink
New repository format (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz authored Aug 4, 2024
1 parent 631a6ae commit 2b519e7
Show file tree
Hide file tree
Showing 19 changed files with 774 additions and 179 deletions.
113 changes: 34 additions & 79 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,86 +1,41 @@
name: Build

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
release:
types: [published]

jobs:
build:
name: Build ${{ matrix.firmware.name }}
runs-on: ubuntu-latest
strategy:
matrix:
firmware:
- file: m5stack-atom-echo.yaml
name: M5 Stack Atom Echo
manifest_filename: m5stack-atom-echo-manifest.json
- file: m5stack-atom-speaker-kit.yaml
name: M5 Stack Atom Speaker Kit
manifest_filename: m5stack-atom-speaker-kit-manifest.json
- file: raspiaudio-muse-proto.yaml
name: Raspiaudio Muse Proto
manifest_filename: raspiaudio-muse-proto-manifest.json
- file: raspiaudio-muse-luxe.yaml
name: Raspiaudio Muse Luxe
manifest_filename: raspiaudio-muse-luxe-manifest.json
fail-fast: false
steps:
- name: Checkout source code
uses: actions/[email protected]
- name: Build firmware
uses: esphome/[email protected]
id: esphome-build
with:
yaml_file: ${{ matrix.firmware.file }}
version: latest
- name: Copy firmware and manifest
run: |
mkdir output
mv ${{ steps.esphome-build.outputs.name }} output/
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 }}
- name: Upload artifact
uses: actions/[email protected]
with:
name: ${{ matrix.firmware.name }}
path: output
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-firmware:
name: Build Firmware
uses: esphome/workflows/.github/workflows/build.yml@main
with:
files: |
m5stack/m5stack-atom-echo.factory.yaml
m5stack/m5stack-atom-speaker-kit.factory.yaml
onju-voice/onju-voice.factory.yaml
raspiaudio/raspiaudio-muse-luxe.factory.yaml
raspiaudio/raspiaudio-muse-proto.factory.yaml
esphome-version: 2024.7.3
release-summary: ${{ github.event_name == 'release' && github.event.release.body || '' }}
release-url: ${{ github.event_name == 'release' && github.event.release.html_url || '' }}
release-version: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }}

consolidate:
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main'
name: Consolidate firmwares
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Download built firmwares
uses: actions/download-artifact@v3
with:
path: firmwares
- name: Copy files
run: |-
mkdir output
cp -R static/* output/
cp -R firmwares/*/* output/
- name: Upload GitHub Pages artifact
uses: actions/[email protected]
with:
path: output

deploy:
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main'
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: consolidate
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]
upload:
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
name: Upload to R2
needs:
- build-firmware
uses: esphome/workflows/.github/workflows/upload.yml@main
with:
name: wake-word-voice-assistant
version: ${{ needs.build-firmware.outputs.version }}
secrets: inherit
22 changes: 22 additions & 0 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: YAML lint

on:
push:
branches: [main]
paths:
- "**.yaml"
- "**.yml"
pull_request:
paths:
- "**.yaml"
- "**.yml"

jobs:
yamllint:
name: 🧹 yamllint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out configuration from GitHub
uses: actions/[email protected]
- name: 🚀 Run yamllint
run: yamllint --strict .
19 changes: 19 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
extends: default

ignore-from-file: .gitignore

rules:
document-start: disable
empty-lines:
level: error
max: 1
max-start: 0
max-end: 1
indentation:
level: error
spaces: 2
indent-sequences: true
check-multi-line-strings: false
line-length: disable
truthy: disable
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# This repository is deprecated

We have copied the source files to https://github.com/esphome/firmware/tree/main/media-player and the firmware is generated there.

# ESPHome Media Players

This repo hosts known, tested devices that can server as media players to Home Assistant.
This repo hosts known, tested devices that can serve as media players to Home Assistant.
25 changes: 25 additions & 0 deletions m5stack/m5stack-atom-echo.factory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
packages:
m5stack-atom-echo: !include m5stack-atom-echo.yaml

esphome:
project:
name: m5stack.atom-echo
version: dev

ota:
- platform: http_request
id: ota_http_request

update:
- platform: http_request
id: update_http_request
name: Firmware
source: https://firmware.esphome.io/media-player/m5stack-atom-echo/manifest.json

http_request:
verify_ssl: false

dashboard_import:
package_import_url: github://esphome/media-players/m5stack/m5stack-atom-echo.yaml@main

improv_serial:
42 changes: 23 additions & 19 deletions m5stack-atom-echo.yaml → m5stack/m5stack-atom-echo.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
substitutions:
name: "m5stack-atom-echo"
friendly_name: "M5Stack Atom Echo"
wifi_ap_password: ""

esphome:
name: ${name}
friendly_name: ${friendly_name}
name: m5stack-atom-echo
friendly_name: M5Stack Atom Echo
min_version: 2024.6.0
name_add_mac_suffix: true
project:
name: m5stack.atom-echo
version: "1.0"
min_version: 2023.5.0

esp32:
board: m5stack-atom
Expand All @@ -19,22 +11,20 @@ esp32:

logger:
api:
ota:

dashboard_import:
package_import_url: github://esphome/media-players/m5stack-atom-echo.yaml@main
ota:
- platform: esphome
id: ota_esphome

wifi:
ap:
password: "${wifi_ap_password}"

captive_portal:

improv_serial:

i2s_audio:
i2s_lrclk_pin: GPIO33
i2s_bclk_pin: GPIO19
- id: i2s_audio_bus
i2s_lrclk_pin: GPIO33
i2s_bclk_pin: GPIO19

microphone:
- platform: i2s_audio
Expand Down Expand Up @@ -99,6 +89,11 @@ binary_sensor:
- timing:
- ON FOR AT LEAST 350ms
then:
- if:
condition:
media_player.is_playing: media_out
then:
- media_player.stop: media_out
- voice_assistant.start:
- timing:
- ON FOR AT LEAST 350ms
Expand Down Expand Up @@ -128,3 +123,12 @@ light:
- pulse:
transition_length: 250ms
update_interval: 250ms

button:
- platform: safe_mode
id: button_safe_mode
name: Safe Mode Boot

- platform: factory_reset
id: factory_reset_btn
name: Factory reset
25 changes: 25 additions & 0 deletions m5stack/m5stack-atom-speaker-kit.factory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
packages:
m5stack-atom-speaker-kit: !include m5stack-atom-speaker-kit.yaml

esphome:
project:
name: m5stack.atom-speaker-kit
version: dev

ota:
- platform: http_request
id: ota_http_request

update:
- platform: http_request
id: update_http_request
name: Firmware
source: https://firmware.esphome.io/media-player/m5stack-atom-speaker-kit/manifest.json

http_request:
verify_ssl: false

dashboard_import:
package_import_url: github://esphome/media-players/m5stack/m5stack-atom-speaker-kit.yaml@main

improv_serial:
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
substitutions:
name: "m5stack-atom-speaker-kit"
friendly_name: "M5Stack Atom Speaker Kit"
wifi_ap_password: ""

esphome:
name: ${name}
friendly_name: ${friendly_name}
name: m5stack-atom-speaker-kit
friendly_name: M5Stack Atom Speaker Kit
min_version: 2024.6.0
name_add_mac_suffix: true
project:
name: m5stack.atom-speaker-kit
version: "1.0"

esp32:
board: m5stack-atom
Expand All @@ -18,21 +11,19 @@ esp32:

logger:
api:
ota:

dashboard_import:
package_import_url: github://esphome/media-players/m5stack-atom-speaker-kit.yaml@main
ota:
- platform: esphome
id: ota_esphome

wifi:
ap:
password: "${wifi_ap_password}"

captive_portal:

improv_serial:

i2s_audio:
- i2s_lrclk_pin: GPIO21
- id: i2s_audio_bus
i2s_lrclk_pin: GPIO21
i2s_bclk_pin: GPIO22

media_player:
Expand All @@ -48,14 +39,25 @@ binary_sensor:
pin:
number: GPIO39
inverted: true
id: top_button
name: Button
on_click:
- media_player.toggle: media_out

light:
- platform: fastled_clockless
id: led
name: None
pin: GPIO27
chipset: SK6812
num_leds: 1
rgb_order: grb

button:
- platform: safe_mode
id: button_safe_mode
name: Safe Mode Boot

- platform: factory_reset
id: factory_reset_btn
name: Factory reset
25 changes: 25 additions & 0 deletions onju-voice/onju-voice.factory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
packages:
onju-voice: !include onju-voice.yaml

esphome:
project:
name: onju.voice-assistant
version: dev

ota:
- platform: http_request
id: ota_http_request

update:
- platform: http_request
id: update_http_request
name: Firmware
source: https://firmware.esphome.io/media-player/onju-voice/manifest.json

http_request:
verify_ssl: false

dashboard_import:
package_import_url: github://esphome/media-players/onju-voice/onju-voice.yaml@main

improv_serial:
Loading

0 comments on commit 2b519e7

Please sign in to comment.