Update configuration variables description style (#4134)
* Update configuration variables description style * Remove defaults
This commit is contained in:
parent
fe29bfce80
commit
38dc270db4
3 changed files with 148 additions and 38 deletions
|
@ -25,16 +25,50 @@ switch:
|
|||
resource: http://IP_ADDRESS/ENDPOINT
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **resource** (*Required*): The resource or endpoint that contains the value.
|
||||
- **name** (*Optional*): Name of the REST switch.
|
||||
- **method** (*Optional*): HTTP method to use (`post` or `put`). Defaults to `post`.
|
||||
- **username** (*Optional*): The username for accessing the REST endpoint.
|
||||
- **password** (*Optional*): The password for accessing the REST endpoint.
|
||||
- **body_on** (*Optional*): The body of the POST request that commands the switch to become enabled. Default is "ON". This value can be a [template](/topics/templating/).
|
||||
- **body_off** (*Optional*): The body of the POST request that commands the switch to become disabled. Default is "OFF". This value can also be a [template](/topics/templating/).
|
||||
- **is_on_template** (*Optional*): A [template](/docs/configuration/templating/#processing-incoming-data) that determines the state of the switch from the value returned by the GET request on the resource URL. This template should compute to a boolean (True or False). If the value is valid JSON, it will be available in the template as the variable `value_json`. Default is equivalent to `'{% raw %}{{ value_json == body_on }}{% endraw %}'`. This means that by default, the state of the switch is on if and only if the response to the GET request matches .
|
||||
{% configuration %}
|
||||
resource:
|
||||
description: The resource or endpoint that contains the value.
|
||||
required: true
|
||||
type: string
|
||||
default: string
|
||||
method:
|
||||
description: "The method of the request. Supported `post` or `put`."
|
||||
required: false
|
||||
type: string
|
||||
default: POST
|
||||
name:
|
||||
description: Name of the REST Switch.
|
||||
required: false
|
||||
type: string
|
||||
default: REST Binary Switch
|
||||
timeout:
|
||||
description: Timeout for the request.
|
||||
required: false
|
||||
type: int
|
||||
default: 10
|
||||
body_on:
|
||||
description: "The body of the POST request that commands the switch to become enabled. This value can be a [template](/topics/templating/)."
|
||||
required: false
|
||||
type: string
|
||||
default: ON
|
||||
body_off:
|
||||
description: "The body of the POST request that commands the switch to become disabled. This value can also be a [template](/topics/templating/)."
|
||||
required: false
|
||||
type: string
|
||||
default: OFF
|
||||
is_on_template:
|
||||
description: "A [template](/docs/configuration/templating/#processing-incoming-data) that determines the state of the switch from the value returned by the GET request on the resource URL. This template should compute to a boolean (True or False). If the value is valid JSON, it will be available in the template as the variable `value_json`. Default is equivalent to `'{% raw %}{{ value_json == body_on }}{% endraw %}'`. This means that by default, the state of the switch is on if and only if the response to the GET request matches."
|
||||
required: false
|
||||
type: string
|
||||
username:
|
||||
description: The username for accessing the REST endpoint.
|
||||
required: false
|
||||
type: string
|
||||
password:
|
||||
description: The password for accessing the REST endpoint.
|
||||
required: false
|
||||
type: string
|
||||
{% endconfiguration %}
|
||||
|
||||
<p class='note warning'>
|
||||
Make sure that the URL matches exactly your endpoint or resource.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue