From b6a61edcf469fb0cd13cefd49411693ca9bdbf6f Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 16 Dec 2023 04:15:26 -0500 Subject: [PATCH] Revert "Fix restarting and starting voice_assistant" This reverts commit 09e76eb8d0ee4e97d1a3cdf12302ab0cb3c1b2ed. --- supersensor.yaml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/supersensor.yaml b/supersensor.yaml index 5f380df..1512aff 100644 --- a/supersensor.yaml +++ b/supersensor.yaml @@ -195,22 +195,20 @@ script: } interval: - - interval: 5s + - interval: 1s then: - - logger.log: "Checking Voice Assistant is running" - if: condition: - and: - - api.connected: - - switch.is_on: use_wake_word - - not: - - voice_assistant.is_running + api.connected: then: - - logger.log: "Voice Assistant not running; restarting it" - - switch.turn_off: use_wake_word - - delay: 1s - - switch.turn_on: use_wake_word - - delay: 1s + - if: + condition: + and: + - switch.is_on: use_wake_word + - not: + - voice_assistant.is_running + then: + - voice_assistant.start_continuous: logger: level: DEBUG @@ -647,7 +645,12 @@ switch: entity_category: config on_turn_on: - 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: - voice_assistant.stop - lambda: id(assist).set_use_wake_word(false);