Use substitutions instead

This commit is contained in:
Edward Firmo
2024-12-23 18:28:58 +01:00
parent 6343e6eb4a
commit 248f7e9cd8
2 changed files with 15 additions and 10 deletions

View File

@@ -15,6 +15,7 @@ substitutions:
RELAY_MODE_TEXT_SWITCH: "Switch"
RELAY_MODE_TEXT_LIGHT: "Light"
RELAY_MODE_TEXT_NOT_USED: "Not in use"
RELAY_RESTORE_MODE: RESTORE_DEFAULT_OFF
globals:
- id: boot_initialization_relays
@@ -29,7 +30,7 @@ light:
output: output_relay_1
platform: binary
internal: true
restore_mode: RESTORE_DEFAULT_OFF
restore_mode: ${RELAY_RESTORE_MODE}
on_turn_on:
then:
- if:
@@ -350,7 +351,7 @@ switch:
name: Relay 1
output: output_relay_1
platform: output
restore_mode: RESTORE_DEFAULT_OFF
restore_mode: ${RELAY_RESTORE_MODE}
internal: true
on_turn_on:
then:
@@ -373,7 +374,7 @@ switch:
name: Relay 2
output: output_relay_2
platform: output
restore_mode: RESTORE_DEFAULT_OFF
restore_mode: ${RELAY_RESTORE_MODE}
internal: true
on_turn_on:
then:
@@ -396,7 +397,7 @@ switch:
name: Relay 3
output: output_relay_3
platform: output
restore_mode: RESTORE_DEFAULT_OFF
restore_mode: ${RELAY_RESTORE_MODE}
internal: true
on_turn_on:
then:
@@ -419,7 +420,7 @@ switch:
name: Relay 4
output: output_relay_4
platform: output
restore_mode: RESTORE_DEFAULT_OFF
restore_mode: ${RELAY_RESTORE_MODE}
internal: true
on_turn_on:
then: