Skip to content
Merged
Changes from all 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
40 changes: 39 additions & 1 deletion content/components/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ captive_portal:
sensor:
- platform: uptime
id: uptime_sensor
update_interval: 1min
update_interval: 5min
```

```yaml
Expand All @@ -194,6 +194,31 @@ sensor:
update_interval: 10s
```

`!extend` also works with substitutions and jinja:

```yaml
substitutions:
switches:
- left_switch
- right_switch
- center_switch

mains_switch: 1

switch:
- platform: gpio
id: left_switch
pin: 1
- platform: gpio
id: right_switch
pin: 2
- platform: gpio
id: center_switch
pin: 3
- id: !extend ${ switches[mains_switch] }
name: "Mains switch"
```

{{< anchor "config-packages_remove" >}}

## Remove
Expand Down Expand Up @@ -229,6 +254,19 @@ sensor:
update_interval: !remove
```

`!remove` also works with substitutions:

```yaml
substitutions:
disable_reboot: true

switch:
- platform: restart
id: restart_switch
name: "Living Room Restart"
- id: !remove ${disable_reboot and "restart_switch"}
```

## See Also

- {{< docref "/index" "ESPHome index" >}}
Expand Down