Improve detection of connection

This commit is contained in:
Joshua Boniface 2025-05-24 01:02:44 -04:00
parent 40f0ae215a
commit cec8d27a4a

View File

@ -278,24 +278,26 @@ 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 - switch.is_on: enable_voice_support
then: then:
- micro_wake_word.start: - micro_wake_word.start:
- script.execute: light_off
- delay: 1s
- 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()"]
- light.turn_on:
id: output_led
effect: flash_white
- if: - if:
condition: condition:
- switch.is_on: enable_voice_support - switch.is_on: enable_voice_support
then: then:
- micro_wake_word.stop: - micro_wake_word.stop:
- light.turn_on:
id: output_led
effect: flash_white
ota: ota:
platform: esphome platform: esphome