esphome:
  name: outlet
  name_add_mac_suffix: true # This option adds MAC address to the end of the device name
  on_boot:
    - switch.turn_on: switch_1

rtl87xx:
  board: t102-v1.1

#logger:
#  level: NONE

#debug:

web_server:
    version: 1

#mdns:

# Enable Home Assistant API
#api:
#  password: "123"

ota:
#  password: "321"

wifi:
  power_save_mode: high
  networks:
  - ssid: "RADIONET"
    password: "xxxxxxxx"
  - ssid: "RADIONET-NAS"
    password: ""

# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "outlet fallback"
    password: "xxxxxxxx"
#    ap_timeout: 40s
    manual_ip:
      static_ip: 192.168.111.1
      gateway: 0.0.0.0
      subnet: 255.255.255.0
captive_portal:

output:
  - platform: gpio
    id: output_led_1
    pin:
        number: PA0
        inverted: true

light:
  - platform: status_led
    id: light_switch_1
    output: output_led_1

binary_sensor:
  - platform: gpio
    id: binary_switch_1
    pin:
      number: PA5
      inverted: true
      mode: INPUT_PULLUP
    filters:
      - delayed_on: 10ms
    on_press:
      then:
        - switch.toggle: switch_1

switch:
  - platform: gpio
    id: switch_1
    name: POWER
    pin:
        number: PA14
        mode: OUTPUT
    on_turn_on:
      - light.turn_on: light_switch_1
    on_turn_off:
      - light.turn_off: light_switch_1
