substitutions:
  device_id: basement_bathroom_light_fan
  device_name: Basement Bathroom Light and Fan
  platform: ESP8266
  board: esp01_1m
  ip_address: !secret basement_bathroom_light_fan_ip
  ota_pwd: !secret basement_bathroom_light_fan_ota_pwd
  api_pwd: !secret basement_bathroom_light_fan_api_pwd
  ap_wifi_pwd: !secret basement_bathroom_light_fan_ap_wifi_pwd

esphome:
  <<: !include common/esphome.yaml

<<: !include common/common.yaml
<<: !include common/logger/logger_none.yaml

binary_sensor:
  - !include common/binary_sensor/status.yaml
  - platform: gpio
    id: light_button
    pin:
      number: 12
      mode: INPUT_PULLUP
    on_press:
      then:
        - switch.toggle: light
  - platform: gpio
    id: fan_button
    pin:
      number: 3
      mode: INPUT_PULLUP
    on_press:
      then:
        - fan.toggle: the_fan

fan:
  - platform: binary
    id: the_fan
    output: fan_output
    name: "Basement Bathroom Fan"

output:
  - platform: gpio
    id: fan_output
    pin: 4

sensor:
  - !include common/sensor/uptime.yaml
  - !include common/sensor/wifi.yaml

status_led:
  pin:
    number: 0
    inverted: true

switch:
  - !include common/switch/restart.yaml
  - platform: gpio
    id: light
    name: "Basement Bathroom Light"
    icon: mdi:lightbulb
    pin: 13

text_sensor:
  - !include common/text_sensor/version.yaml
  - !include common/text_sensor/wifi.yaml