Skip to content

Commit

Permalink
fix voice assistant notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
landonr committed May 11, 2024
1 parent 5109c9f commit b976359
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 55 deletions.
26 changes: 11 additions & 15 deletions common/voice_assistant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,18 @@ voice_assistant:
on_start:
then:
- homething_menu.clear_notifications: homeThingMenu
- homething_menu.add_notification:
title: "Voice Assistant"
subtitle: "Listening"
- lambda: |-
id(homeThingMenu)->addNotification("Voice Assistant", "Listening", "", true);
on_error:
then:
- homething_menu.add_notification:
title: "Voice Assistant"
subtitle: "Error"
message: |-
return x;
persistent: true
lambda: |-
id(homeThingMenu)->addNotification("Voice Assistant", "Error", message, false);
on_stt_end:
then:
- homething_menu.add_notification:
title: "Voice Assistant"
subtitle: "Understood"
message: |-
return x;
persistent: true
lambda: |-
id(homeThingMenu)->addNotification("Voice Assistant", "Understood", x, false);
on_tts_start:
then:
lambda: |-
if (x.compare("Started") == 0) return;
id(homeThingMenu)->addNotification("Voice Assistant", "", x, true);
41 changes: 1 addition & 40 deletions tdisplay-s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ packages:
settings: github://landonr/homeThing/common/settings.yaml@main
images: github://landonr/homeThing/common/images.yaml@main
nowPlayingImage: github://landonr/homeThing/common/nowPlayingImage.yaml@main
voice_assistant: github://landonr/homeThing/common/voice_assistant.yaml@main

# ipod
battery: github://landonr/homeThing/common/ipod/lilygo_tdisplay_ipod_battery.yaml@main
Expand Down Expand Up @@ -228,46 +229,6 @@ text_sensor:
name: "Weather state"
id: weather_state

### Voice Assistant

i2s_audio:
i2s_lrclk_pin: 3 # WS
i2s_bclk_pin: 2 # SCK

microphone:
- platform: i2s_audio
id: external_mic
i2s_din_pin: 1 # SD
adc_type: external
pdm: false
# bits_per_sample: 32bit
channel: left

voice_assistant:
microphone: external_mic
on_start:
then:
- homething_menu.clear_notifications: homeThingMenu
- homething_menu.add_notification:
title: "Voice Assistant"
subtitle: "Listening"
on_error:
then:
- homething_menu.add_notification:
title: "Voice Assistant"
subtitle: "Error"
message: |-
return x;
persistent: true
on_stt_end:
then:
- homething_menu.add_notification:
title: "Voice Assistant"
subtitle: "Understood"
message: |-
return x;
persistent: true

### Weather App

homeThingAppWeather:
Expand Down

0 comments on commit b976359

Please sign in to comment.