substitutions:
  name: klima-shinco
  friendly_name: "Klimatyzacja Shinco"
  ir_address: "0xE710"

esphome:
  name: ${name}
  friendly_name: ${friendly_name}

esp8266:
  board: esp12e

logger:
  baud_rate: 0

api:
  encryption:
    key: !secret api_encryption_key

ota:
  - platform: esphome
    password: !secret ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: "${friendly_name} Fallback"
    password: !secret ap_password

captive_portal:

# Odbiornik aktywny — HA wykryje też użycie fizycznego pilota
remote_receiver:
  pin:
    number: GPIO14
    inverted: true
  dump: nec
  tolerance: 25%
  idle: 25ms

remote_transmitter:
  pin: GPIO4
  carrier_duty_percent: 50%

button:
  # ---------- POWER ----------
  - platform: template
    name: "Power (wł/wył)"
    icon: "mdi:power"
    on_press:
      - remote_transmitter.transmit_nec:
          address: ${ir_address}
          command: 0xFF00

  # ---------- TRYB CHŁODZENIA ----------
  - platform: template
    name: "Tryb chłodzenie"
    icon: "mdi:snowflake"
    on_press:
      - remote_transmitter.transmit_nec:
          address: ${ir_address}
          command: 0xEB14

  # ---------- TRYB OSUSZANIA ----------
  - platform: template
    name: "Tryb osuszanie"
    icon: "mdi:water-percent"
    on_press:
      - remote_transmitter.transmit_nec:
          address: ${ir_address}
          command: 0xF30C

  # ---------- TRYB WENTYLATORA ----------
  - platform: template
    name: "Tryb wentylator"
    icon: "mdi:fan"
    on_press:
      - remote_transmitter.transmit_nec:
          address: ${ir_address}
          command: 0xF708

  # ---------- TEMPERATURA + ----------
  - platform: template
    name: "Temperatura +"
    icon: "mdi:thermometer-chevron-up"
    on_press:
      - remote_transmitter.transmit_nec:
          address: ${ir_address}
          command: 0xEA15

  # ---------- TEMPERATURA - ----------
  - platform: template
    name: "Temperatura -"
    icon: "mdi:thermometer-chevron-down"
    on_press:
      - remote_transmitter.transmit_nec:
          address: ${ir_address}
          command: 0xF20D

  # ---------- WENTYLATOR WOLNY ----------
  - platform: template
    name: "Wentylator wolny"
    icon: "mdi:fan-speed-1"
    on_press:
      - remote_transmitter.transmit_nec:
          address: ${ir_address}
          command: 0xF10E

  # ---------- WENTYLATOR SZYBKI ----------
  - platform: template
    name: "Wentylator szybki"
    icon: "mdi:fan-speed-2"
    on_press:
      - remote_transmitter.transmit_nec:
          address: ${ir_address}
          command: 0xE916
