Revert "Fix restarting and starting voice_assistant"

This reverts commit 09e76eb8d0ee4e97d1a3cdf12302ab0cb3c1b2ed.
This commit is contained in:
Joshua Boniface 2023-12-16 04:15:26 -05:00
parent 6f0cc86312
commit b6a61edcf4

View File

@ -195,22 +195,20 @@ script:
} }
interval: interval:
- interval: 5s - interval: 1s
then:
- if:
condition:
api.connected:
then: then:
- logger.log: "Checking Voice Assistant is running"
- if: - if:
condition: condition:
and: and:
- api.connected:
- switch.is_on: use_wake_word - switch.is_on: use_wake_word
- not: - not:
- voice_assistant.is_running - voice_assistant.is_running
then: then:
- logger.log: "Voice Assistant not running; restarting it" - voice_assistant.start_continuous:
- switch.turn_off: use_wake_word
- delay: 1s
- switch.turn_on: use_wake_word
- delay: 1s
logger: logger:
level: DEBUG level: DEBUG
@ -647,6 +645,11 @@ switch:
entity_category: config entity_category: config
on_turn_on: on_turn_on:
- lambda: id(assist).set_use_wake_word(true); - lambda: id(assist).set_use_wake_word(true);
- if:
condition:
not:
- voice_assistant.is_running
then:
- voice_assistant.start_continuous - voice_assistant.start_continuous
on_turn_off: on_turn_off:
- voice_assistant.stop - voice_assistant.stop