Skip to content

Commit 8a7de33

Browse files
committed
Make filters consistent
1 parent b6dd4f1 commit 8a7de33

File tree

15 files changed

+43
-49
lines changed

15 files changed

+43
-49
lines changed

content/components/sensor/filter/clamp.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ Configuration variables:
1313

1414
```yaml
1515
# Example configuration entry
16-
- platform: wifi_signal
17-
# ...
18-
filters:
19-
- clamp:
20-
min_value: 10
21-
max_value: 75
22-
ignore_out_of_range: true
16+
filters:
17+
- clamp:
18+
min_value: 10
19+
max_value: 75
20+
ignore_out_of_range: true
2321
```

content/components/sensor/filter/delta.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ For example if the filter were configured with a value of 2 and the last value p
1212
only values greater than or equal to 12 or less than or equal to 8 would be passed through.
1313

1414
```yaml
15+
# Example configuration entry
1516
filters:
1617
- delta: 2.0
1718
```
@@ -23,6 +24,7 @@ However, if the last value passed through was 100 only values greater than or eq
2324
equal to 80 would be passed through.
2425
2526
```yaml
27+
# Example configuration entry
2628
filters:
2729
- delta: 20%
2830
```

content/components/sensor/filter/filter_out.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,16 @@ headless: true
77

88
```yaml
99
# Example configuration entry
10-
- platform: wifi_signal
11-
# ...
12-
filters:
13-
- filter_out: 85.0
10+
filters:
11+
- filter_out: 85.0
1412
```
1513
1614
A list of values may be supplied, and values are templatable:
1715
1816
```yaml
1917
# Example configuration entry
20-
- platform: wifi_signal
21-
# ...
22-
filters:
23-
- filter_out:
24-
- 85.0
25-
- !lambda return id(some_sensor).state;
18+
filters:
19+
- filter_out:
20+
- 85.0
21+
- !lambda return id(some_sensor).state;
2622
```

content/components/sensor/filter/heartbeat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Configuration variables:
2222
arrives, regardless of the configured time interval.
2323

2424
```yaml
25-
# Example filters
25+
# Example configuration entry
2626
filters:
2727
- heartbeat: 5s
2828
- heartbeat:

content/components/sensor/filter/lambda.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Perform a simple mathematical operation over the sensor values. The input value
77
the result of the lambda is used as the output (use `return` ).
88

99
```yaml
10+
# Example configuration entry
1011
filters:
1112
- lambda: return x * (9.0/5.0) + 32.0;
1213
```
@@ -17,6 +18,7 @@ result in integers (not floating point values).
1718
To prevent values from being published, return `{}` :
1819

1920
```yaml
21+
# Example configuration entry
2022
filters:
2123
- lambda: |-
2224
if (x < 10) return {};

content/components/sensor/filter/offset.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ Adds a value to each sensor value. The value may be a constant or a lambda retur
77

88
```yaml
99
# Example configuration entry
10-
- platform: adc
11-
# ...
12-
filters:
13-
- offset: 2.0
14-
- multiply: 1.2
15-
- offset: !lambda return id(some_sensor).state;
10+
filters:
11+
- offset: 2.0
12+
- offset: !lambda return id(some_sensor).state;
1613
```

content/components/sensor/filter/or.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ will only pass forward values that are *either* at least 1s old or are if the ab
88
difference is at least 5.0.
99

1010
```yaml
11-
# Example filters:
11+
# Example configuration entry
1212
filters:
1313
- or:
1414
- throttle: 1s

content/components/sensor/filter/round.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ headless: true
66
Rounds the value to the given decimal places.
77

88
```yaml
9-
- platform: ...
10-
filters:
11-
- round: 1 # will round to 1 decimal place
9+
# Example configuration entry
10+
filters:
11+
- round: 1 # will round to 1 decimal place
1212
```

content/components/sensor/filter/round_to_multiple_of.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ headless: true
66
Rounds the value to the nearest multiple. Takes a float greater than zero.
77

88
```yaml
9-
- platform: ...
10-
filters:
11-
- round_to_multiple_of: 10
12-
# 123 -> 120
13-
# 126 -> 130
9+
# Example configuration entry
10+
filters:
11+
- round_to_multiple_of: 10
12+
# 123 -> 120
13+
# 126 -> 130
1414

15-
- platform: ...
16-
filters:
17-
- round_to_multiple_of: 0.25
18-
# 3.1415 -> 3.25
19-
# 1.6180 -> 1.5
15+
# Example configuration entry
16+
filters:
17+
- round_to_multiple_of: 0.25
18+
# 3.1415 -> 3.25
19+
# 1.6180 -> 1.5
2020
```

content/components/sensor/filter/skip_initial.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ readings have been skipped, this filter does nothing.
99

1010
```yaml
1111
# Example configuration entry
12-
- platform: wifi_signal
13-
# ...
14-
filters:
15-
- skip_initial: 3
12+
filters:
13+
- skip_initial: 3
1614
```

0 commit comments

Comments
 (0)