1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

Add mqtt.on_connect and mqtt.on_disconnect triggers (#3520)

This commit is contained in:
jimtng
2022-06-03 11:51:50 +10:00
committed by GitHub
parent 6221f6d47d
commit 4f57bf786b
4 changed files with 62 additions and 0 deletions

View File

@@ -168,6 +168,13 @@ mqtt:
id: uart0
data: !lambda |-
return {};
on_connect:
- light.turn_on: ${roomname}_lights
- mqtt.publish:
topic: some/topic
payload: Hello
on_disconnect:
- light.turn_off: ${roomname}_lights
i2c:
sda: 21