From 855ccbaeb452456c5d638802969604db3714f274 Mon Sep 17 00:00:00 2001 From: Agneev Mukherjee <19761269+agneevX@users.noreply.github.com> Date: Mon, 27 Apr 2020 14:04:32 +0530 Subject: [PATCH] Corrected code syntax (#13188) --- .../switch.command_line.markdown | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/source/_integrations/switch.command_line.markdown b/source/_integrations/switch.command_line.markdown index 16551f82d0f..a0c9b95d6a9 100644 --- a/source/_integrations/switch.command_line.markdown +++ b/source/_integrations/switch.command_line.markdown @@ -86,14 +86,14 @@ which is controllable through REST. ```yaml # Example configuration.yaml entry switch: - platform: command_line - switches: - arest_pin_four: - command_on: "/usr/bin/curl -X GET http://192.168.1.10/digital/4/1" - command_off: "/usr/bin/curl -X GET http://192.168.1.10/digital/4/0" - command_state: "/usr/bin/curl -X GET http://192.168.1.10/digital/4" - value_template: '{% raw %}{{ value == "1" }}{% endraw %}' - friendly_name: Kitchen Lightswitch + - platform: command_line + switches: + arest_pin_four: + command_on: "/usr/bin/curl -X GET http://192.168.1.10/digital/4/1" + command_off: "/usr/bin/curl -X GET http://192.168.1.10/digital/4/0" + command_state: "/usr/bin/curl -X GET http://192.168.1.10/digital/4" + value_template: '{% raw %}{{ value == "1" }}{% endraw %}' + friendly_name: Kitchen Lightswitch ``` Given this example, in the UI one would see the `friendly_name` of @@ -112,10 +112,10 @@ This switch will shutdown your host immediately, there will be no confirmation. ```yaml # Example configuration.yaml entry switch: - platform: command_line - switches: - home_assistant_system_shutdown: - command_off: "/usr/sbin/poweroff" + - platform: command_line + switches: + home_assistant_system_shutdown: + command_off: "/usr/sbin/poweroff" ``` ### Control your VLC player @@ -126,11 +126,11 @@ This switch will control a local VLC media player ```yaml # Example configuration.yaml entry switch: - platform: command_line - switches: - vlc: - command_on: "cvlc 1.mp3 vlc://quit &" - command_off: "pkill vlc" + - platform: command_line + switches: + vlc: + command_on: "cvlc 1.mp3 vlc://quit &" + command_off: "pkill vlc" ``` ### Control Foscam Motion Sensor @@ -143,13 +143,13 @@ which checks the current state of motion detection. ```yaml # Example configuration.yaml entry switch: - platform: command_line - switches: - foscam_motion: - command_on: 'curl -k "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&usr=admin&pwd=password"' - command_off: 'curl -k "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=0&usr=admin&pwd=password"' - command_state: 'curl -k --silent "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=admin&pwd=password" | grep -oP "(?<=isEnable>).*?(?=)"' - value_template: {% raw %}'{{ value == "1" }}'{% endraw %} + - platform: command_line + switches: + foscam_motion: + command_on: 'curl -k "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&usr=admin&pwd=password"' + command_off: 'curl -k "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=0&usr=admin&pwd=password"' + command_state: 'curl -k --silent "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=admin&pwd=password" | grep -oP "(?<=isEnable>).*?(?=)"' + value_template: {% raw %}'{{ value == "1" }}'{% endraw %} ``` - Replace admin and password with an "Admin" privileged Foscam user