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: then:
- logger.log: "Checking Voice Assistant is running"
- if: - if:
condition: condition:
and: api.connected:
- api.connected:
- switch.is_on: use_wake_word
- not:
- voice_assistant.is_running
then: then:
- logger.log: "Voice Assistant not running; restarting it" - if:
- switch.turn_off: use_wake_word condition:
- delay: 1s and:
- switch.turn_on: use_wake_word - switch.is_on: use_wake_word
- delay: 1s - not:
- voice_assistant.is_running
then:
- voice_assistant.start_continuous:
logger: logger:
level: DEBUG level: DEBUG
@ -647,7 +645,12 @@ 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);
- voice_assistant.start_continuous - if:
condition:
not:
- voice_assistant.is_running
then:
- voice_assistant.start_continuous
on_turn_off: on_turn_off:
- voice_assistant.stop - voice_assistant.stop
- lambda: id(assist).set_use_wake_word(false); - lambda: id(assist).set_use_wake_word(false);