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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user