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

migrate mww to esphome_audio, bring back volume control and media_player #39

Merged
merged 9 commits into from
May 9, 2024
10 changes: 9 additions & 1 deletion esphome/onju-voice-microwakeword.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ esphome:
- wait_until:
condition:
wifi.connected:
- script.execute: restore_volume
- light.turn_on:
id: top_led
effect: pulse
Expand Down Expand Up @@ -119,6 +120,10 @@ globals:
- id: notification
type: bool
restore_value: false
- id: restore_media_player_volume
type: float
initial_value: "0.5f"
restore_value: true

interval:
- interval: 1s
Expand Down Expand Up @@ -523,7 +528,10 @@ script:
then:
- media_player.volume_set:
id: onju_out
volume: !lambda return clamp(id(onju_out).volume+volume, 0.0f, 1.0f);
volume: !lambda |-
float new_volume = clamp(id(onju_out).volume+volume, 0.0f, 1.0f);
cowboyrushforth marked this conversation as resolved.
Show resolved Hide resolved
id(restore_media_player_volume) = new_volume;
return new_volume;

- id: show_volume
mode: restart
Expand Down