# This file is prepared for Factory firmware. Use it only if you know what you're doing.

packages:
  va_connected_wait_for_ble:
    voice_assistant:
      on_client_connected:
        - wait_until:
            not: ble.enabled
        - delay: 2s
    wifi:
      on_disconnect:
        - ble.enable:
  koala-satellite: !include common/koala-base.yaml

# Commented out for auto-publishing. Uncomment if build manually.

# ota:
#   - platform: http_request
#     id: ota_http_request

# http_request:

# update:
#   - platform: http_request
#     name: Firmware Update
#     update_interval: 30min
#     source: https://formatbce.github.io/Koala-Satellite/manifest.json

dashboard_import:
  package_import_url: github://formatBCE/Koala-Satellite/config/koala-dashboard.yaml@main
  import_full_config: false

wifi:
  on_connect:
    - delay: 5s
    - ble.disable:
    - script.execute: control_leds

improv_serial:

esp32_ble:
  name: koala-ble

esp32_improv:
  authorizer: user_button
  on_start:
    - lambda: id(improv_ble_in_progress) = true;
    - script.execute: control_leds
  on_provisioned:
    - lambda: id(improv_ble_in_progress) = false;
    - script.execute: control_leds
  on_stop:
    - lambda: id(improv_ble_in_progress) = false;
    - script.execute: control_leds
