Corrected code syntax (#13188)

This commit is contained in:
Agneev Mukherjee 2020-04-27 14:04:32 +05:30 committed by GitHub
parent 49e617df30
commit 855ccbaeb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,14 +86,14 @@ which is controllable through REST.
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
switch: switch:
platform: command_line - platform: command_line
switches: switches:
arest_pin_four: arest_pin_four:
command_on: "/usr/bin/curl -X GET http://192.168.1.10/digital/4/1" 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_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" command_state: "/usr/bin/curl -X GET http://192.168.1.10/digital/4"
value_template: '{% raw %}{{ value == "1" }}{% endraw %}' value_template: '{% raw %}{{ value == "1" }}{% endraw %}'
friendly_name: Kitchen Lightswitch friendly_name: Kitchen Lightswitch
``` ```
Given this example, in the UI one would see the `friendly_name` of 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 ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
switch: switch:
platform: command_line - platform: command_line
switches: switches:
home_assistant_system_shutdown: home_assistant_system_shutdown:
command_off: "/usr/sbin/poweroff" command_off: "/usr/sbin/poweroff"
``` ```
### Control your VLC player ### Control your VLC player
@ -126,11 +126,11 @@ This switch will control a local VLC media player
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
switch: switch:
platform: command_line - platform: command_line
switches: switches:
vlc: vlc:
command_on: "cvlc 1.mp3 vlc://quit &" command_on: "cvlc 1.mp3 vlc://quit &"
command_off: "pkill vlc" command_off: "pkill vlc"
``` ```
### Control Foscam Motion Sensor ### Control Foscam Motion Sensor
@ -143,13 +143,13 @@ which checks the current state of motion detection.
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
switch: switch:
platform: command_line - platform: command_line
switches: switches:
foscam_motion: foscam_motion:
command_on: 'curl -k "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&usr=admin&pwd=password"' 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_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>).*?(?=</isEnable>)"' command_state: 'curl -k --silent "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=admin&pwd=password" | grep -oP "(?<=isEnable>).*?(?=</isEnable>)"'
value_template: {% raw %}'{{ value == "1" }}'{% endraw %} value_template: {% raw %}'{{ value == "1" }}'{% endraw %}
``` ```
- Replace admin and password with an "Admin" privileged Foscam user - Replace admin and password with an "Admin" privileged Foscam user