Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move provisioning config to factory file #69

Merged
merged 4 commits into from
Sep 2, 2024
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 .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: esphome/workflows/.github/workflows/build.yml@main
with:
files: |
voice-kit.yaml
voice-kit.factory.yaml
esphome-version: 2024.8.1
release-summary: ${{ github.event_name == 'release' && github.event.release.body || '' }}
release-url: ${{ github.event_name == 'release' && github.event.release.html_url || '' }}
Expand Down
61 changes: 61 additions & 0 deletions voice-kit.factory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
packages:
# This is an inline package to prefix the on_client_connected with the wait_until action
# It must appear before the actual package so it becomes the orignal config and the
# on_client_connected list from the package config is appended onto this one.
va_connected_wait_for_ble:
voice_assistant:
on_client_connected:
- wait_until:
not: ble.enabled
- delay: 2s
wifi:
on_disconnect:
- ble.enable:
voice-kit: !include voice-kit.yaml

esphome:
project:
name: esphome.voice-kit
version: dev

ota:
- platform: http_request
id: ota_http_request

http_request:

update:
- platform: http_request
name: None
id: update_http_request
source: https://esphome.github.io/voice-kit/manifest.json

dashboard_import:
package_import_url: github://esphome/voice-kit/voice-kit.yaml

wifi:
on_connect:
- delay: 5s # Gives time for improv results to be transmitted
- ble.disable:
- script.execute: control_leds

improv_serial:

esp32_improv:
authorizer: center_button

button:
# TODO: Remove before launch, added for testing/development
- platform: template
name: Check for update
entity_category: diagnostic
on_press:
- component.update: update_http_request
# TODO: Remove before launch, added for testing/development
- platform: template
name: Perform Update
entity_category: diagnostic
on_press:
- update.perform:
id: update_http_request
force_update: true
40 changes: 1 addition & 39 deletions voice-kit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ esphome:
name: esphome-voice-kit
friendly_name: ESPHome Voice Kit
name_add_mac_suffix: true
min_version: 2024.8.1
platformio_options:
board_build.flash_mode: dio
project:
name: esphome.voice-kit
version: dev
on_boot:
priority: 600
then:
Expand Down Expand Up @@ -66,11 +64,7 @@ wifi:
ap:
on_connect:
- script.execute: control_leds
- delay: 5s # Gives time for improv results to be transmitted
- ble.disable:
- script.execute: control_leds
on_disconnect:
- ble.enable:
- script.execute: control_leds

logger:
Expand All @@ -87,21 +81,6 @@ api:
ota:
- platform: esphome
id: ota_esphome
- platform: http_request
id: ota_http_request

http_request:

update:
- platform: http_request
name: None
id: update_http_request
source: https://esphome.github.io/voice-kit/manifest.json

improv_serial:

esp32_improv:
authorizer: center_button

i2c:
sda: GPIO5
Expand Down Expand Up @@ -1201,9 +1180,6 @@ voice_assistant:
auto_gain: 0 dbfs
volume_multiplier: 1
on_client_connected:
- wait_until:
not: ble.enabled
- delay: 2s
- lambda: id(init_in_progress) = false;
- micro_wake_word.start:
- lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id};
Expand Down Expand Up @@ -1273,20 +1249,6 @@ button:
.set_announcement(true)
.set_local_media_file(id(timer_finished_wave_file))
.perform();
# TODO: Remove before launch, added for testing/development
- platform: template
name: Check for update
entity_category: diagnostic
on_press:
- component.update: update_http_request
# TODO: Remove before launch, added for testing/development
- platform: template
name: Perform Update
entity_category: diagnostic
on_press:
- update.perform:
id: update_http_request
force_update: true

debug:
update_interval: 5s