diff --git a/content/components/packages.md b/content/components/packages.md index 5d4f7889d8..20af5a6aa3 100644 --- a/content/components/packages.md +++ b/content/components/packages.md @@ -182,7 +182,7 @@ captive_portal: sensor: - platform: uptime id: uptime_sensor - update_interval: 1min + update_interval: 5min ``` ```yaml @@ -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 @@ -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" >}}