From 0f32dbdd606d156f09beb58e7262e9d9bf500197 Mon Sep 17 00:00:00 2001 From: Klaas Schoute Date: Tue, 6 Nov 2018 08:13:18 +0100 Subject: [PATCH] Update Dweet sensor component configuration (#7386) --- source/_components/sensor.dweet.markdown | 29 +++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/source/_components/sensor.dweet.markdown b/source/_components/sensor.dweet.markdown index 1bc81d27e67..6fcfa134ac4 100644 --- a/source/_components/sensor.dweet.markdown +++ b/source/_components/sensor.dweet.markdown @@ -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}}] ``` -