add resource_template configuration resource (#11719)

This commit is contained in:
Hedgehog57 2020-06-24 01:23:52 +03:00 committed by GitHub
parent 182b984c81
commit ef8938ac2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,6 +49,14 @@ binary_sensor:
resource: http://IP_ADDRESS/ENDPOINT resource: http://IP_ADDRESS/ENDPOINT
method: POST method: POST
``` ```
or a template based request:
```yaml
# Example configuration.yaml entry
sensor:
- platform: rest
resource_template: {% raw %} "http://IP_ADDRESS/{{ now().strftime('%Y-%m-%d') }}" {% endraw %}
```
{% configuration %} {% configuration %}
resource: resource:
@ -56,6 +64,10 @@ resource:
required: true required: true
type: string type: string
default: string default: string
resource_template:
description: The resource or endpoint that contains the value with template support.
required: false
type: template
method: method:
description: The method of the request. description: The method of the request.
required: false required: false