From 1090740531949558cfcf3e9ca8de11d13b7780e1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 4 Nov 2017 23:11:05 +0100 Subject: [PATCH] New configuration variable style --- .../binary_sensor.template.markdown | 53 ++++++++-------- source/_components/sensor.luftdaten.markdown | 10 +--- .../sensor.openweathermap.markdown | 60 ++++++++++++++----- 3 files changed, 74 insertions(+), 49 deletions(-) diff --git a/source/_components/binary_sensor.template.markdown b/source/_components/binary_sensor.template.markdown index 62f2a50b1ba..009f4131ddd 100644 --- a/source/_components/binary_sensor.template.markdown +++ b/source/_components/binary_sensor.template.markdown @@ -39,31 +39,36 @@ binary_sensor: required: true type: map keys: - friendly_name: - description: Name to use in the frontend. - required: false - type: string - entity_id: - description: Add a list of entity IDs so the sensor only reacts to state changes of these entities. This will reduce the number of times the sensor will try to update its state. - required: false - type: string, list - device_class: - description: The type/class of the sensor to set the icon in the frontend. - required: false - type: device_class - default: None - value_template: - description: Defines a template to set the state of the sensor. + sensor_name: + description: The slug of the sensor. required: true - type: template - delay_on: - description: The amount of time the template state must be ***met*** before this sensor will switch to `on`. - required: false - type: time - delay_off: - description: The amount of time the template state must be ***not met*** before this sensor will switch to `off`. - required: false - type: time + type: map + keys: + friendly_name: + description: Name to use in the frontend. + required: false + type: string + entity_id: + description: Add a list of entity IDs so the sensor only reacts to state changes of these entities. This will reduce the number of times the sensor will try to update its state. + required: false + type: string, list + device_class: + description: The type/class of the sensor to set the icon in the frontend. + required: false + type: device_class + default: None + value_template: + description: Defines a template to set the state of the sensor. + required: true + type: template + delay_on: + description: The amount of time the template state must be ***met*** before this sensor will switch to `on`. + required: false + type: time + delay_off: + description: The amount of time the template state must be ***not met*** before this sensor will switch to `off`. + required: false + type: time {% endconfiguration %} ## {% linkable_title Considerations %} diff --git a/source/_components/sensor.luftdaten.markdown b/source/_components/sensor.luftdaten.markdown index 5e4b7cde98f..486b10e5f2a 100644 --- a/source/_components/sensor.luftdaten.markdown +++ b/source/_components/sensor.luftdaten.markdown @@ -46,7 +46,7 @@ sensor: default: Luftdaten Sensor type: string resource: - description: The URL of the API endpoint. Usually this has not to be changed. + description: The URL of the API endpoint. Usually this has not to be changed. required: false default: https://api.luftdaten.info/v1/sensor/ type: string @@ -62,19 +62,11 @@ sensor: keys: P1: description: Show the particle sensors (particles 10 microns and below). - required: false - type: string P2: description: Show the particle sensors (particles 2.5 microns and below). - required: false - type: string temperature: description: Display the temperature from a weather sensor. - required: false - type: string humidity: description: Display the humidity from a weather sensor. - required: false - type: string {% endconfiguration %} diff --git a/source/_components/sensor.openweathermap.markdown b/source/_components/sensor.openweathermap.markdown index 116d4cd9e3d..b323534b014 100644 --- a/source/_components/sensor.openweathermap.markdown +++ b/source/_components/sensor.openweathermap.markdown @@ -29,21 +29,49 @@ sensor: - weather ``` -Configuration variables: - -- **api_key** (*Required*): Your API key for http://openweathermap.org/. -- **name** (*Optional*): Additional name for the sensors. Default to platform name. -- **forecast** (*Optional*): Enables the forecast. The default is to display the current conditions. -- **language** (*Optional*): The language in which you want text results to be returned. It's a two-characters string, eg. `en`, `es`, `ru`, `it`, etc. Defaults to English. -- **monitored_conditions** array (*Required*): Conditions to display in the frontend. - - **weather**: A human-readable text summary. - - **temperature**: The current temperature. - - **wind_speed**: The wind speed. - - **wind_bearing**: The wind bearing. - - **humidity**: The relative humidity. - - **pressure**: The sea-level air pressure in millibars. - - **clouds**: Description about cloud coverage. - - **rain**: The rain volume. - - **snow**: The snow volume +{% configuration %} + apk_key: + description: Your API key for http://openweathermap.org/. + required: true + type: string + name: + description: Additional name for the sensors. Default to platform name. + required: false + default: OWM + type: string + forecast: + description: Enables the forecast. The default is to display the current conditions. + required: false + default: false + type: string + language: + description: The language in which you want text results to be returned. It's a two-characters string, eg. `en`, `es`, `ru`, `it`, etc. + required: false + default: en + type: string + monitored_conditions: + description: Conditions to display in the frontend. + required: true + type: list + keys: + weather: + description: A human-readable text summary. + temperature: + description: The current temperature. + wind_speed: + description: The wind speed. + wind_bearing: + description: The wind bearing. + humidity: + description: The relative humidity. + pressure: + description: The sea-level air pressure in millibars. + clouds: + description: Description about cloud coverage. + rain: + description: The rain volume. + snow: + description: The snow volume. +{% endconfiguration %} Details about the API are available in the [OpenWeatherMap documentation](http://openweathermap.org/api).