# Shared hardware/network boilerplate for the lvgl_clock example_*.yaml
# configs. Included via `packages:` - each example adds its own `esphome:`
# name and `lvgl: widgets: - lvgl_clock: ...` on top.

substitutions:
  # Pins for the SPI bus used to drive the display
  clk_pin: "GPIO18"
  mosi_pin: "GPIO13"
  miso_pin: "GPIO12"
  # Pins for the display itself
  reset_pin: "GPIO04"
  cs_pin: "GPIO16"
  dc_pin: "GPIO17"

esp32:
  board: esp32-s3-devkitc1-n16r8
  framework:
    type: esp-idf

#enable psram for the ESP32-S3 - required for LVGL to work with a 480x320 display    
psram:
  mode: octal # check your board's PSRAM mode, octal is the default for ESP32-S3
  speed: 80MHz

logger:
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

api:
  encryption:
    key: !secret api_key
ota:
  - platform: esphome
    password: !secret ota_password

external_components:
  - source: ../components
    components: [lvgl_clock]

time:
  - platform: sntp
    id: clock_time
    timezone: "CET-1CEST,M3.5.0,M10.5.0/3"

# marker only - enables the lvgl_clock widget, takes no options itself.
lvgl_clock:

# Shared colour palette for the lvgl_clock example_*.yaml
# configs. 

color:
  - id: cc_hands
    red: 100%
    green: 100%
    blue: 100%
  - id: cc_bg
    red: 0%
    green: 0%
    blue: 0%
  - id: cc_faces  # unlit "ghost" segments / little-clock faces
    red: 12%
    green: 12%
    blue: 14%