# =============================================================================
# Sorties relais DOMO22
# Version: 1.0
# Date: 2025-10-31
# Produit: ECO-DOMO-22
# 8 relais 10A - Sorties sécurisées
# =============================================================================

switch:
  # Relais 1 - Éclairage principal
  - platform: gpio
    pin: GPIO13
    name: "Relais 1 - Éclairage Principal"
    id: relay_1
    icon: "mdi:lightbulb"
    restore_mode: RESTORE_DEFAULT_OFF
    on_turn_on:
      - logger.log: "Relais 1 activé"
    on_turn_off:
      - logger.log: "Relais 1 désactivé"

  # Relais 2 - Éclairage secondaire
  - platform: gpio
    pin: GPIO12
    name: "Relais 2 - Éclairage Secondaire"
    id: relay_2
    icon: "mdi:lightbulb-outline"
    restore_mode: RESTORE_DEFAULT_OFF

  # Relais 3 - Prise salon
  - platform: gpio
    pin: GPIO14
    name: "Relais 3 - Prise Salon"
    id: relay_3
    icon: "mdi:power-socket-eu"
    restore_mode: RESTORE_DEFAULT_OFF

  # Relais 4 - Ventilation
  - platform: gpio
    pin: GPIO27
    name: "Relais 4 - Ventilation"
    id: relay_4
    icon: "mdi:fan"
    restore_mode: RESTORE_DEFAULT_OFF

  # Relais 5 - Chauffage
  - platform: gpio
    pin: GPIO26
    name: "Relais 5 - Chauffage"
    id: relay_5
    icon: "mdi:radiator"
    restore_mode: RESTORE_DEFAULT_OFF

  # Relais 6 - Pompe
  - platform: gpio
    pin: GPIO25
    name: "Relais 6 - Pompe"
    id: relay_6
    icon: "mdi:pump"
    restore_mode: RESTORE_DEFAULT_OFF

  # Relais 7 - Portail (impulsion 500ms)
  - platform: gpio
    pin: GPIO33
    name: "Relais 7 - Portail"
    id: relay_7
    icon: "mdi:gate"
    restore_mode: RESTORE_DEFAULT_OFF
    on_turn_on:
      - delay: 500ms
      - switch.turn_off: relay_7

  # Relais 8 - Réserve (personnalisable)
  - platform: gpio
    pin: GPIO32
    name: "Relais 8 - Réserve"
    id: relay_8
    icon: "mdi:power"
    restore_mode: RESTORE_DEFAULT_OFF
