diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0cbae22..9067833 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 || '' }} diff --git a/voice-kit.factory.yaml b/voice-kit.factory.yaml new file mode 100644 index 0000000..a70fc9e --- /dev/null +++ b/voice-kit.factory.yaml @@ -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 diff --git a/voice-kit.yaml b/voice-kit.yaml index 492fbcc..587807c 100644 --- a/voice-kit.yaml +++ b/voice-kit.yaml @@ -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: @@ -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: @@ -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 @@ -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}; @@ -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