Actually fix conditional logic
This commit is contained in:
parent
9555fd37dc
commit
e62b9a8b91
@ -276,22 +276,23 @@ interval:
|
|||||||
condition:
|
condition:
|
||||||
lambda: 'return api::global_api_server->is_connected();'
|
lambda: 'return api::global_api_server->is_connected();'
|
||||||
then:
|
then:
|
||||||
|
- light.turn_off: output_led # Stop LED flashing when connected
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
- switch.is_on: enable_voice_support
|
lambda: |-
|
||||||
- not:
|
return id(enable_voice_support).state &&
|
||||||
condition:
|
!id(mww).is_running();
|
||||||
micro_wake_word.is_running:
|
|
||||||
then:
|
then:
|
||||||
- micro_wake_word.start:
|
- micro_wake_word.start:
|
||||||
- script.execute: light_off
|
|
||||||
else:
|
else:
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: output_led
|
id: output_led
|
||||||
effect: flash_white
|
effect: flash_white
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
- switch.is_on: enable_voice_support
|
lambda: |-
|
||||||
|
return id(enable_voice_support).state &&
|
||||||
|
id(mww).is_running();
|
||||||
then:
|
then:
|
||||||
- micro_wake_word.stop:
|
- micro_wake_word.stop:
|
||||||
|
|
||||||
@ -305,27 +306,28 @@ api:
|
|||||||
- logger.log:
|
- logger.log:
|
||||||
format: "Client %s (IP %s) connected to API"
|
format: "Client %s (IP %s) connected to API"
|
||||||
args: ["client_info.c_str()", "client_address.c_str()"]
|
args: ["client_info.c_str()", "client_address.c_str()"]
|
||||||
|
- script.execute: light_off
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
- switch.is_on: enable_voice_support
|
lambda: |-
|
||||||
- not:
|
return id(enable_voice_support).state &&
|
||||||
condition:
|
!id(mww).is_running();
|
||||||
micro_wake_word.is_running:
|
|
||||||
then:
|
then:
|
||||||
- micro_wake_word.start:
|
- micro_wake_word.start:
|
||||||
- script.execute: light_off
|
|
||||||
on_client_disconnected:
|
on_client_disconnected:
|
||||||
- logger.log:
|
- logger.log:
|
||||||
format: "Client %s (IP %s) disconnected from API"
|
format: "Client %s (IP %s) disconnected from API"
|
||||||
args: ["client_info.c_str()", "client_address.c_str()"]
|
args: ["client_info.c_str()", "client_address.c_str()"]
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
lambda: |-
|
||||||
|
return id(enable_voice_support).state &&
|
||||||
|
id(mww).is_running();
|
||||||
|
then:
|
||||||
|
- micro_wake_word.stop:
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: output_led
|
id: output_led
|
||||||
effect: flash_white
|
effect: flash_white
|
||||||
- if:
|
|
||||||
condition:
|
|
||||||
- switch.is_on: enable_voice_support
|
|
||||||
then:
|
|
||||||
- micro_wake_word.stop:
|
|
||||||
|
|
||||||
ota:
|
ota:
|
||||||
platform: esphome
|
platform: esphome
|
||||||
|
Loading…
x
Reference in New Issue
Block a user