Update Dweet sensor component configuration (#7386)

This commit is contained in:
Klaas Schoute 2018-11-06 08:13:18 +01:00 committed by Fabian Affolter
parent cd62d7d996
commit 0f32dbdd60

View File

@ -25,12 +25,25 @@ sensor:
value_template: '{% raw %}{{ value_json.VARIABLE }}{% endraw %}'
```
Configuration variables:
- **device** (*Required*): Identification of the device (also known as `thing`).
- **value_template** (*Required*): The variable to extract a value from the content.
- **name** (*Optional*): Let you overwrite the name of the device in the frontend.
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any.
{% configuration %}
device:
description: Identification of the device (also known as `thing`).
required: true
type: string
value_template:
description: The variable to extract a value from the content.
required: true
type: template
name:
description: Let you overwrite the name of the device in the frontend.
required: false
default: Dweet.io Sensor
type: string
unit_of_measurement:
description: Defines the unit of measurement of the sensor, if any.
required: false
type: string
{% endconfiguration %}
### {% linkable_title Full configuration sample %}
@ -53,6 +66,7 @@ You can easily send dweets from the command-line to test your sensor with `curl`
```bash
$ curl -H 'Content-Type: application/json' -d '{"temperature": 40, "humidity": 65}' https://dweet.io/dweet/for/ha-sensor
```
will give you a response like the one below:
```json
@ -61,7 +75,7 @@ will give you a response like the one below:
The [dweepy](https://github.com/paddycarey/dweepy) module gives you another option to work with [Dweet.io](https://dweet.io/).
Send a dweet.
Send a dweet.
```bash
$ python3
@ -76,4 +90,3 @@ Receive the latest dweet.
>>> dweepy.get_latest_dweet_for('ha-sensor')
[{'thing': 'ha-sensor'', 'created': '2015-12-10T09:43:31.133Z', 'content': {'humidity': 65, 'temperature': 40}}]
```