Skip to content

Commit 70232f9

Browse files
klaasnicolaasfabaff
authored andcommitted
Update shell_command component configuration (home-assistant#7471)
1 parent df2d7ba commit 70232f9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

source/_components/shell_command.markdown

+8-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ shell_command:
2525
restart_pow: touch ~/.pow/restart.txt
2626
```
2727
28-
Configuration variables:
28+
{% configuration %}
29+
alias:
30+
description: Give the shell command a name (alias) as a variable and set the command you want to execute after the colon. e.g., `alias`:`the shell command you want to execute`.
31+
required: true
32+
type: string
33+
{% endconfiguration %}
2934

30-
- Alias for the command
31-
- Command itself.
32-
33-
The commands can be dynamic, using templates to insert values for arguments. When using templates, shell_command runs in a more secure environment which doesn't allow any shell helpers like automatically expanding the home dir `~` or using pipe symbols to run multiple commands. Similarly, only content after the first space can be generated by a template. This means the command name itself cannot be generated by a template, but it must be literally provided.
35+
The commands can be dynamic, using templates to insert values for arguments. When using templates, shell_command runs in a more secure environment which doesn't allow any shell helpers like automatically expanding the home dir `~` or using pipe symbols to run multiple commands. Similarly, only content after the first space can be generated by a template. This means the command name itself cannot be generated by a template, but it must be literally provided.
3436

3537
Any service data passed into the service call to activate the shell command will be available as a variable within the template.
3638

@@ -54,7 +56,7 @@ input_number:
5456
min: 18
5557
max: 32
5658
step: 1
57-
59+
5860
{% raw %}
5961
shell_command:
6062
set_ac_to_slider: 'irsend SEND_ONCE DELONGHI AC_{{ states.input_number.ac_temperature.state }}_AUTO'

0 commit comments

Comments
 (0)