Skip to content

Commit 93b097f

Browse files
hillaryfraleyfabaff
authored andcommitted
Fixed typos and format inconsistencies (home-assistant#1123)
Please check these sentences: "We test the configuration to ensure that users have a great experience and minimize notifications if something is wrong with a platform or component setup before Home Assistant runs." "If a sensor has a pre-defined list of available options, test to make sure the configuration entry matches the list." I wasn't sure if I got the intent correct, and in the second one I wasn't sure what you meant by "it"
1 parent 7b5efaa commit 93b097f

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

source/developers/development_validation.markdown

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,33 @@ sharing: true
99
footer: true
1010
---
1111

12-
The `configuration.yaml` file contains the configuration options for components and platforms. To ensure that the given configuration provided by the user is valid we use [voluptuous](https://pypi.python.org/pypi/voluptuous) to check it. Certain entries are optional or could be required for the setup of a platform or a component. Others must be of a definied type or out of an already defined list.
12+
The `configuration.yaml` file contains the configuration options for components and platforms. We use [voluptuous](https://pypi.python.org/pypi/voluptuous) to make sure that the configuration provided by the user is valid. Some entries are optional or could be required to set up a platform or a component. Others must be a defined type or from an already-defined list.
1313

14-
The goal of testing the configuration is to assure that users have a great experience due to notifications if something is wrong with a platform or component setup before Home Assistant is running.
14+
We test the configuration to ensure that users have a great experience and minimize notifications if something is wrong with a platform or component setup before Home Assistant runs.
1515

16-
Beside the [voluptuous](https://pypi.python.org/pypi/voluptuous) default types are a bunch of custom types available. To get a full overview take a look at the [config_validation.py](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/helpers/config_validation.py) helper.
16+
Besides [voluptuous](https://pypi.python.org/pypi/voluptuous) default types, many custom types are available. For an overview, take a look at the [config_validation.py](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/helpers/config_validation.py) helper.
1717

1818
- Types: `string`, `byte`, and `boolean`
1919
- Entity ID: `entity_id` and `entity_ids`
2020
- Numbers: `small_float` and `positive_int`
2121
- Time: `time`, `time_zone`
2222
- Misc: `template`, `slug`, `temperature_unit`, `latitude`, `longitude`, `isfile`, `sun_event`, `ensure_list`, `port`, `url`, and `icon`
2323

24-
To validate plaforms using [MQTT](/components/mqtt/) there are `valid_subscribe_topic` and `valid_publish_topic` present.
24+
To validate plaforms using [MQTT](/components/mqtt/), `valid_subscribe_topic` and `valid_publish_topic` are available.
2525

2626
Some things to keep in mind:
2727

28-
- Use the constants which are definded in `const.py`.
29-
- Import `PLATFORM_SCHEMA` from parent component and extend it.
30-
- Preferred order is `required` first, then `optional`.
28+
- Use the constants defined in `const.py`
29+
- Import `PLATFORM_SCHEMA` from the parent component and extend it
30+
- Preferred order is `required` first and `optional` second
3131

3232
### {% linkable_title Snippets %}
3333

34-
This section contains a couple of snippets for the validation we use.
34+
This section contains snippets for the validation we use.
3535

36-
### {% linkable_title Default name %}
36+
#### {% linkable_title Default name %}
3737

38-
It's common to set a default for a sensor if the user is not providing a name to use.
38+
It's common to set a default for a sensor if the user doesn't provide a name to use.
3939

4040
```python
4141
DEFAULT_NAME = 'Sensor name'
@@ -45,9 +45,9 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
4545
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
4646
```
4747

48-
### {% linkable_title Limit the values %}
48+
#### {% linkable_title Limit the values %}
4949

50-
In certain cases you want to limit the user's input to a couple of options.
50+
You might want to limit the user's input to a couple of options.
5151

5252
```python
5353
DEFAULT_METHOD = 'GET'
@@ -57,9 +57,9 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
5757
vol.Optional(CONF_METHOD, default=DEFAULT_METHOD): vol.In(['POST', 'GET']),
5858
```
5959

60-
### {% linkable_title Port %}
60+
#### {% linkable_title Port %}
6161

62-
As all port numbers are coming out of the range 1 till 65535.
62+
All port numbers are from a range of 1 to 65535.
6363

6464
```python
6565
DEFAULT_PORT = 993
@@ -69,9 +69,9 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
6969
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
7070
```
7171

72-
### {% linkable_title Lists %}
72+
#### {% linkable_title Lists %}
7373

74-
If a sensor has a pre-defined list of available options it should be tested if the configuration entry matches it.
74+
If a sensor has a pre-defined list of available options, test to make sure the configuration entry matches the list.
7575

7676
```python
7777
SENSOR_TYPES = {
@@ -84,5 +84,3 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
8484
vol.Optional(CONF_MONITORED_VARIABLES, default=[]):
8585
vol.All(ensure_list, [vol.In(SENSOR_TYPES)]),
8686
```
87-
88-

0 commit comments

Comments
 (0)