Skip to content

Commit

Permalink
VA flow improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
tetele committed Jan 15, 2025
1 parent da64fc6 commit f7743d5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
10 changes: 7 additions & 3 deletions esphome/onju-modules/voice_assistant-nabu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ voice_assistant:
noise_suppression_level: 0
auto_gain: 0 dbfs
volume_multiplier: 1
on_start:
- nabu.set_ducking:
decibel_reduction: 20 # Number of dB quieter; higher implies more quiet, 0 implies full volume
duration: 0.0s # The duration of the transition (default is 0)
on_end:
then:
- lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id};
- script.execute: control_led
- nabu.set_ducking:
decibel_reduction: 0 # 0 dB means no reduction
duration: 1.0s
13 changes: 13 additions & 0 deletions esphome/onju-modules/voice_assistant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ voice_assistant:
on_tts_start:
- lambda: id(voice_assistant_phase) = ${voice_assist_replying_phase_id};
- script.execute: control_led
on_end:
- wait_until:
not:
voice_assistant.is_running:
# If the end happened because of an error, let the error phase on for a second
- if:
condition:
lambda: return id(voice_assistant_phase) == ${voice_assist_error_phase_id};
then:
- delay: 1s
# Reset the voice assistant phase id and reset the LED animations.
- lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id};
- script.execute: control_led
on_client_connected:
- lambda: id(init_in_progress) = false;
- lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id};
Expand Down

0 comments on commit f7743d5

Please sign in to comment.