Skip to content

Commit

Permalink
Move provisioning config to factory file (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz authored Sep 2, 2024
1 parent e369b4c commit 1554ef7
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 40 deletions.
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 @@ -68,11 +66,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 @@ -89,21 +83,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 @@ -1211,9 +1190,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 @@ -1283,20 +1259,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

0 comments on commit 1554ef7

Please sign in to comment.