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
# 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>).*?(?=</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>).*?(?=</isEnable>)"'
value_template: {% raw %}'{{ value == "1" }}'{% endraw %}
```
- Replace admin and password with an "Admin" privileged Foscam user