esphome:
  name: ble-keyboard-remote
  friendly_name: BLE Keyboard Remote

esp32:
  board: esp32dev
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_BT_ENABLED: y
      CONFIG_BT_CONTROLLER_ENABLED: y
      CONFIG_BT_BLUEDROID_ENABLED: y
      CONFIG_BT_NIMBLE_ENABLED: n
      CONFIG_BT_BLE_ENABLED: y
      CONFIG_BT_GATTS_ENABLE: y
      CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y
      CONFIG_BT_BLE_50_FEATURES_SUPPORTED: n
      CONFIG_BT_BLE_42_ADV_EN: y
      CONFIG_BT_BLE_42_SCAN_EN: y
      CONFIG_BT_BLE_SMP_ENABLE: y
      CONFIG_BT_ACL_CONNECTIONS: "4"

logger:
  level: INFO

api:
  encryption:
    key: "PM6X8++VY/FTLnmDTMj9IVKv1aBUzXf4l6FmlgjT2Nw="

ota:
  - platform: esphome

wifi:
  ssid: "MyNetwork"
  password: "MyWifiPassword"

external_components:
  - source:
      type: git
      url: https://github.com/markusg1234/ESPHome-espidf_ble_keyboard.git
      ref: v1.21.1
      path: components
    refresh: 0s
    components: [ espidf_ble_keyboard ]

# Required by `web_control: true` below - it hosts the control page.
web_server:
  port: 80

espidf_ble_keyboard:
  id: my_keyboard
  web_control: true
  host_slots: 4
  keyboard_layout: us
  api_services: true
  ha_action: true

button:
  - platform: espidf_ble_keyboard
    keyboard_id: my_keyboard
    name: "Win + R (Run Dialog)"
    action: "combo:0x08:0x15"
  - platform: espidf_ble_keyboard
    keyboard_id: my_keyboard
    name: "Type Hello"
    action: "Hello\n"
  - platform: espidf_ble_keyboard
    keyboard_id: my_keyboard
    name: "Next host"
    action: "switch_host:next"
