mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 23:36:51 +00:00
Update configuration variables description style (#4134)
* Update configuration variables description style * Remove defaults
This commit is contained in:
parent
fe29bfce80
commit
38dc270db4
@ -47,25 +47,61 @@ binary_sensor:
|
|||||||
method: POST
|
method: POST
|
||||||
```
|
```
|
||||||
|
|
||||||
Configuration variables:
|
{% configuration %}
|
||||||
|
resource:
|
||||||
- **resource** (*Required*): The resource or endpoint that contains the value.
|
description: The resource or endpoint that contains the value.
|
||||||
- **method** (*Optional*): The method of the request. Default is GET.
|
required: true
|
||||||
- **name** (*Optional*): Name of the REST binary sensor.
|
type: string
|
||||||
- **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend.
|
default: string
|
||||||
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the value.
|
method:
|
||||||
- **payload** (*Optional*): The payload to send with a POST request. Usually formed as a dictionary.
|
description: The method of the request.
|
||||||
- **verify_ssl** (*Optional*): Verify the certification of the endpoint. Default to True.
|
required: false
|
||||||
- **authentication** (*Optional*): Type of the HTTP authentication. `basic` or `digest`.
|
type: string
|
||||||
- **username** (*Optional*): The username for accessing the REST endpoint.
|
default: GET
|
||||||
- **password** (*Optional*): The password for accessing the REST endpoint.
|
name:
|
||||||
- **headers** (*Optional*): The headers for the requests.
|
description: Name of the REST binary sensor.
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: REST Binary Sensor
|
||||||
|
device_class:
|
||||||
|
description: "The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend."
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
value_template:
|
||||||
|
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the value."
|
||||||
|
required: false
|
||||||
|
type: template
|
||||||
|
payload:
|
||||||
|
description: The payload to send with a POST request. Usually formed as a dictionary.
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
verify_ssl:
|
||||||
|
description: Verify the certification of the endpoint.
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: True
|
||||||
|
authentication:
|
||||||
|
description: Type of the HTTP authentication. `basic` or `digest`.
|
||||||
|
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
|
||||||
|
headers:
|
||||||
|
description: The headers for the requests.
|
||||||
|
required: false
|
||||||
|
type: list, string
|
||||||
|
{% endconfiguration %}
|
||||||
|
|
||||||
<p class='note warning'>
|
<p class='note warning'>
|
||||||
Make sure that the URL exactly matches your endpoint or resource.
|
Make sure that the URL exactly matches your endpoint or resource.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
## {% linkable_title Examples %}
|
## {% linkable_title Examples %}
|
||||||
|
|
||||||
In this section you find some real life examples of how to use this sensor.
|
In this section you find some real life examples of how to use this sensor.
|
||||||
|
@ -36,20 +36,60 @@ sensor:
|
|||||||
payload: '{ "device" : "heater" }'
|
payload: '{ "device" : "heater" }'
|
||||||
```
|
```
|
||||||
|
|
||||||
Configuration variables:
|
{% configuration %}
|
||||||
|
resource:
|
||||||
- **resource** (*Required*): The resource or endpoint that contains the value.
|
description: The resource or endpoint that contains the value.
|
||||||
- **method** (*Optional*): The method of the request. Default is `GET`.
|
required: true
|
||||||
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the value.
|
type: string
|
||||||
- **payload** (*Optional*): The payload to send with a POST request. Depends on the service, but usually formed as JSON.
|
default: string
|
||||||
- **name** (*Optional*): Name of the REST sensor.
|
method:
|
||||||
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any.
|
description: The method of the request.
|
||||||
- **verify_ssl** (*Optional*): Verify the certification of the endpoint. Default to `True`.
|
required: false
|
||||||
- **authentication** (*Optional*): Type of the HTTP authentication. `basic` or `digest`.
|
type: string
|
||||||
- **username** (*Optional*): The username for accessing the REST endpoint.
|
default: GET
|
||||||
- **password** (*Optional*): The password for accessing the REST endpoint.
|
name:
|
||||||
- **headers** (*Optional*): The headers for the requests.
|
description: Name of the REST sensor.
|
||||||
- **json_attributes** (*Optional*): A list of keys to extract values from a JSON dictionary result and then set as sensor attributes. Default is an empty list.
|
required: false
|
||||||
|
type: string
|
||||||
|
default: REST Sensor
|
||||||
|
value_template:
|
||||||
|
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the value."
|
||||||
|
required: false
|
||||||
|
type: template
|
||||||
|
payload:
|
||||||
|
description: The payload to send with a POST request. Depends on the service, but usually formed as JSON.
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
verify_ssl:
|
||||||
|
description: Verify the certification of the endpoint.
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: True
|
||||||
|
unit_of_measurement:
|
||||||
|
description: Defines the units of measurement of the sensor, if any.
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
authentication:
|
||||||
|
description: Type of the HTTP authentication. `basic` or `digest`.
|
||||||
|
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
|
||||||
|
headers:
|
||||||
|
description: The headers for the requests.
|
||||||
|
required: false
|
||||||
|
type: list, string
|
||||||
|
json_attributes:
|
||||||
|
description: A list of keys to extract values from a JSON dictionary result and then set as sensor attributes.
|
||||||
|
reqired: false
|
||||||
|
type: list, string
|
||||||
|
{% endconfiguration %}
|
||||||
|
|
||||||
<p class='note warning'>
|
<p class='note warning'>
|
||||||
Make sure that the URL exactly matches your endpoint or resource.
|
Make sure that the URL exactly matches your endpoint or resource.
|
||||||
|
@ -25,16 +25,50 @@ switch:
|
|||||||
resource: http://IP_ADDRESS/ENDPOINT
|
resource: http://IP_ADDRESS/ENDPOINT
|
||||||
```
|
```
|
||||||
|
|
||||||
Configuration variables:
|
{% configuration %}
|
||||||
|
resource:
|
||||||
- **resource** (*Required*): The resource or endpoint that contains the value.
|
description: The resource or endpoint that contains the value.
|
||||||
- **name** (*Optional*): Name of the REST switch.
|
required: true
|
||||||
- **method** (*Optional*): HTTP method to use (`post` or `put`). Defaults to `post`.
|
type: string
|
||||||
- **username** (*Optional*): The username for accessing the REST endpoint.
|
default: string
|
||||||
- **password** (*Optional*): The password for accessing the REST endpoint.
|
method:
|
||||||
- **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/).
|
description: "The method of the request. Supported `post` or `put`."
|
||||||
- **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/).
|
required: false
|
||||||
- **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 .
|
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'>
|
<p class='note warning'>
|
||||||
Make sure that the URL matches exactly your endpoint or resource.
|
Make sure that the URL matches exactly your endpoint or resource.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user