From c5ebcf2f8f20b859af7350f650bffab296e54da0 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 17 Jan 2016 17:15:16 -0800 Subject: [PATCH] Add state docs to command line switch --- source/_components/switch.command_switch.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/_components/switch.command_switch.markdown b/source/_components/switch.command_switch.markdown index 9e0c38b8129..333f2ba277c 100644 --- a/source/_components/switch.command_switch.markdown +++ b/source/_components/switch.command_switch.markdown @@ -23,6 +23,8 @@ switch: kitchen_light: oncmd: switch_command on kitchen offcmd: switch_command off kitchen + statecmd: query_command kitchen + value_template: '{% raw %}{{ value == "online" }}{% endraw %}' ``` Configuration variables: @@ -31,6 +33,8 @@ Configuration variables: - **entry** (*Required*): Name of the command switch. Multiple entries are possible. - **oncmd** (*Required*): The action to take for on. - **offcmd** (*Required*): The action to take for off. + - **statecmd** (*Optional*): If given, this command will be run. Returning a result code `0` will indicate that the switch is on. + - **value_template** (*Optional*): If specified, statecmd will ignore the result code of the command but the template evaluating to `true` will indicate the switch is on. ## {% linkable_title Examples %}