From 59f1ec700727de89e2c4ef876c77674b6a903ba3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 26 Mar 2016 11:28:32 +0100 Subject: [PATCH] Add sensor_class to docs --- source/_components/binary_sensor.rest.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/_components/binary_sensor.rest.markdown b/source/_components/binary_sensor.rest.markdown index e1fac78ddce..d6fc619a1a4 100644 --- a/source/_components/binary_sensor.rest.markdown +++ b/source/_components/binary_sensor.rest.markdown @@ -22,6 +22,7 @@ binary_sensor: resource: http://IP_ADDRESS/ENDPOINT method: GET name: REST GET binary sensor + sensor_class: opening value_template: '{% raw %}{{ value_json.state }}{% endraw %}' ``` @@ -33,18 +34,20 @@ binary_sensor: platform: rest resource: http://IP_ADDRESS/ENDPOINT method: POST + name: REST POST binary sensor + sensor_class: opening value_template: '{% raw %}{{ value_json.state }}{% endraw %}' payload: '{ "device" : "door" }' - name: REST POST binary sensor ``` Configuration variables: - **resource** (*Required*): The resource or endpoint that contains the value. - **method** (*Optional*): The method of the request. Default is GET. +- **name** (*Optional*): Name of the REST binary sensor. +- **sensor_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. - **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value. - **payload** (*Optional*): The payload to send with a POST request. Usualy formed as a dictionary. -- **name** (*Optional*): Name of the REST binary sensor.

Make sure that the URL matches exactly your endpoint or resource.