1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 00:31:58 +00:00

[mqtt] templatable state and command topics (#12441)

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
Rodrigo Martín
2026-01-13 04:40:27 +01:00
committed by GitHub
parent 5890cdf69a
commit e9469cbe48
6 changed files with 66 additions and 36 deletions

View File

@@ -91,6 +91,7 @@ button:
- platform: template
name: "Template Button"
state_topic: some/topic/button
command_topic: !lambda return "some/topic/button/command";
qos: 2
on_press:
- mqtt.disable
@@ -295,7 +296,7 @@ event:
fan:
- platform: template
name: Template Fan
state_topic: some/topic/fan
state_topic: !lambda return "some/topic/fan";
direction_state_topic: some/topic/direction/state
direction_command_topic: some/topic/direction/command
qos: 2