Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions docs/documenting/create-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ There are [pre-defined variables](https://jekyllrb.com/docs/variables/) availabl

### Configuration

Every platform page should contain a configuration sample. This sample must contain only the **required** variables to make it easy to copy and paste it for users into their `configuration.yaml` file.
Every integration page should contain a configuration sample. This sample must contain only the **required** variables to make it easy to copy and paste it for users into their `configuration.yaml` file.

The **Configuration Variables** section must use the `{% configuration %} ... {% endconfiguration %}` tag.
The **Configuration variables** section must use the `{% configuration %} ... {% endconfiguration %}` tag.

```text
{% configuration %}
Expand Down Expand Up @@ -106,7 +106,32 @@ required: exclusive #=> Exclusive
required: any string here #=> Any string here
```

- **`type:`**: The type of the variable. Allowed entries: `action`, `boolean`, `string`, `integer`, `float`, `time`, `template`, `device_class`, `icon`, `map`/`list` (for a list of entries), `date`, `datetime`, `selector`, and `any`. For multiple possibilities use `[string, integer]`. If you use `map`/`list` then should define `keys:` (see the [`template` sensor](https://www.home-assistant.io/integrations/sensor.template/) for an example). If you use `boolean`, then `default:` must be defined.
- **`type:`**: The type of the variable. Allowed entries: `action`, `boolean`, `string`, `integer`, `float`, `time`, `template`, `device_class`, `icon`, `map`/`list` (for a list of entries), `date`, `datetime`, `selector`, and `any`. For multiple possibilities use `[string, integer]`. If you use `map`/`list` then should define `keys:` (see the [`template` sensor](https://www.home-assistant.io/integrations/sensor.template/) for an example). If you use `boolean`, then `default:` must be defined.

### About configuration variables

- The **Configuration variables** section is only used for YAML configuration.
- The **Configuration variables** section must use the `{% configuration %}` tag.
- Configuration variables must document the requirement status (`false` or `true`).
- Configuration variables must document the default value, if any.
- Configuration variables must document the accepted value types (see [configuration variables details](#configuration)).
- For configuration variables that accept multiple types, separate the types with a comma (i.e. `string, integer`).

#### Example configuration variables block

```yaml
{% configuration %}
some_key:
description: This is a description of what this key is for.
required: false
type: string
default: Optional default value - leave out if there isn't one
{% endconfiguration %}
```

### UI variables

- For describing **UI variables** use the `{% configuration_basic %}` section.

### Embedding code

Expand Down
25 changes: 0 additions & 25 deletions docs/documenting/standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,6 @@ Documentation should follow the [Microsoft Style Guide](https://learn.microsoft.
- Use capital letters and `_` to indicate that the value needs to be replaced. For example, `api_key: YOUR_API_KEY` or `api_key: REPLACE_ME`.
- Integration and platform names should be a link to their respective documentation pages.

### Configuration variables

- The **Configuration Variables** section is only used for YAML configuration.
- The **Configuration Variables** section must use the `{% configuration %}` tag.
- Configuration variables must document the requirement status (`false` or `true`).
- Configuration variables must document the default value, if any.
- Configuration variables must document the accepted value types (see [configuration variables details](documenting/create-page.md#configuration)).
- For configuration variables that accept multiple types, separate the types with a comma (i.e. `string, integer`).

#### Example configuration variables block

```yaml
{% configuration %}
some_key:
description: This is a description of what this key is for.
required: false
type: string
default: Optional default value - leave out if there isn't one
{% endconfiguration %}
```

### UI variables

- For describing **UI Variables** the `{% configuration_basic %}` section can be used.

## YAML and templates

We have a separate styling guide for YAML and the use of Jinja2 templates
Expand Down