# WearDash demo - public APIs only: no account, no token, no Home Assistant.
# Made for trying the app (and for store reviewers): point the watch at this
# config (Settings → Config URL) and every screen shows live data immediately.
# One API per screen: Open-Meteo (weather & air quality, Paris), GitHub
# status + ISS position, CoinGecko (Bitcoin), Frankfurter/ECB (currencies).

sources:
  meteo:
    url: "https://api.open-meteo.com/v1/forecast?latitude=48.8566&longitude=2.3522&current=temperature_2m,relative_humidity_2m,wind_speed_10m&hourly=temperature_2m&forecast_days=1&timezone=auto"
    refresh: 300
  air:
    url: "https://air-quality-api.open-meteo.com/v1/air-quality?latitude=48.8566&longitude=2.3522&current=european_aqi,pm2_5,pm10"
    refresh: 600
  github:
    url: "https://www.githubstatus.com/api/v2/status.json"
    refresh: 300
  iss:
    url: "https://api.wheretheiss.at/v1/satellites/25544"
    refresh: 60
  crypto:
    url: "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum&vs_currencies=eur&include_24hr_change=true"
    refresh: 300
  btc_week:
    url: "https://api.coingecko.com/api/v3/coins/bitcoin/market_chart?vs_currency=eur&days=7"
    refresh: 3600
  rates:
    url: "https://api.frankfurter.dev/v1/latest?base=EUR&symbols=USD,GBP,CHF"
    refresh: 3600

actions:
  # Harmless on purpose: a GET, then re-pull every source - demonstrates
  # actions and then_refresh without writing anything anywhere.
  refresh_all:
    method: GET
    url: "https://www.githubstatus.com/api/v2/status.json"
    then_refresh: [meteo, air, github, iss, crypto]

screens:
  - id: weather
    label: "Weather"
    root:
      type: column
      children:
        - { type: text, value: "Paris", size: 18, icon: weather-partly-cloudy,
            icon_color: "#05070b", icon_bg: "#4ecdc4" }
        - type: row
          children:
            - { type: text, value: "{{ round(meteo.current.temperature_2m, 1) }}°",
                size: 16, color: "#4ecdc4", icon: thermometer }
            - { type: text, value: "{{ meteo.current.relative_humidity_2m }}%",
                size: 16, color: "#64b5f6", icon: water-percent }
        - { type: arc, value: "{{ meteo.current.relative_humidity_2m }}", max: "100",
            color: "#64b5f6" }
        - { type: text, value: "{{ round(meteo.current.wind_speed_10m) }} km/h",
            size: 13, color: "#9e9e9e", icon: weather-windy }
        - { type: text, value: "Today, hourly", size: 11, color: "#9e9e9e" }
        - { type: graph, source: meteo, path: "$.hourly.temperature_2m[*]",
            height: 46, color: "#e79064" }
        - { type: button, label: "Refresh", icon: refresh, action: refresh_all,
            condition: "!is_tile" }

  - id: air
    label: "Air quality"
    root:
      type: column
      children:
        - { type: text, value: "Air quality", size: 16, icon: leaf,
            icon_color: "#05070b", icon_bg: "#66bb6a" }
        - { type: text, value: "AQI {{ air.current.european_aqi }}", size: 20,
            color: "{{ air.current.european_aqi <= 50 ? '#66bb6a' : '#ef5350' }}" }
        - { type: arc, value: "{{ air.current.european_aqi }}", max: "100",
            color: "{{ air.current.european_aqi <= 50 ? '#66bb6a' : '#ef5350' }}" }
        - type: row
          children:
            - { type: text, value: "PM2.5 {{ air.current.pm2_5 }}", size: 13,
                color: "#9e9e9e" }
            - { type: spacer, width: 10 }
            - { type: text, value: "PM10 {{ air.current.pm10 }}", size: 13,
                color: "#9e9e9e" }
        - { type: text, value: "European index - under 50 is good", size: 11,
            color: "#9e9e9e" }

  - id: services
    label: "Services"
    root:
      type: column
      children:
        - { type: text, value: "GitHub", size: 16,
            icon: "{{ github.status.indicator == 'none' ? 'check-circle' : 'alert' }}",
            icon_color: "{{ github.status.indicator == 'none' ? '#66bb6a' : '#ef5350' }}" }
        - { type: text, value: "{{ github.status.description }}", size: 12,
            color: "#9e9e9e" }
        - { type: spacer, height: 10 }
        - { type: text, value: "ISS", size: 16, icon: map-marker,
            icon_color: "#05070b", icon_bg: "#e79064" }
        - { type: text,
            value: "{{ round(iss.latitude, 1) }}, {{ round(iss.longitude, 1) }}",
            size: 13, color: "#e79064" }
        - { type: text, value: "{{ round(iss.velocity) }} km/h", size: 13,
            color: "#9e9e9e" }
        - { type: button, label: "Refresh", icon: refresh, action: refresh_all }

  - id: bitcoin
    label: "Bitcoin"
    root:
      type: column
      children:
        - { type: text, value: "Bitcoin", size: 16,
            icon: "{{ crypto.bitcoin.eur_24h_change >= 0 ? 'arrow-up' : 'arrow-down' }}",
            icon_color: "{{ crypto.bitcoin.eur_24h_change >= 0 ? '#66bb6a' : '#ef5350' }}" }
        - { type: text, value: "{{ round(crypto.bitcoin.eur) }} €", size: 22 }
        - { type: text, value: "{{ round(crypto.bitcoin.eur_24h_change, 1) }}% / 24h",
            size: 13,
            color: "{{ crypto.bitcoin.eur_24h_change >= 0 ? '#66bb6a' : '#ef5350' }}" }
        - { type: text, value: "7 days", size: 11, color: "#9e9e9e" }
        - { type: graph, source: btc_week, path: "$.prices[*][1]",
            height: 46, color: "#e79064" }
        - { type: text,
            value: "ETH {{ round(crypto.ethereum.eur) }} € ({{ round(crypto.ethereum.eur_24h_change, 1) }}%)",
            size: 13,
            color: "{{ crypto.ethereum.eur_24h_change >= 0 ? '#66bb6a' : '#ef5350' }}" }

  - id: rates
    label: "Currencies"
    root:
      type: column
      children:
        - { type: text, value: "1 EUR =", size: 16 }
        - { type: text, value: "{{ rates.rates.USD }} USD", size: 18, color: "#4ecdc4" }
        - { type: text, value: "{{ rates.rates.GBP }} GBP", size: 18, color: "#64b5f6" }
        - { type: text, value: "{{ rates.rates.CHF }} CHF", size: 18, color: "#e79064" }
        - { type: text, value: "ECB reference rates, {{ rates.date }}", size: 11,
            color: "#9e9e9e" }

# One swipe from the watch face (Wear OS tile / Apple Smart Stack widget).
tiles:
  - id: weather
    label: "Weather"
    screen: weather
  - id: bitcoin
    label: "Bitcoin"
    screen: bitcoin

# Watch-face complications: add a WearDash complication from the face, then
# pick what each slot shows in the app settings.
complications:
  - id: temp
    label: "Temperature"
    type: short_text
    value: "{{ round(meteo.current.temperature_2m) }}°"
    title: "Paris"
    icon: thermometer
    screen: weather
  - id: humidity
    label: "Humidity"
    type: ranged_value
    value: "{{ meteo.current.relative_humidity_2m }}"
    title: "Humidity"
    icon: water-percent
    min: 0
    max: 100
    screen: weather
  - id: aqi
    label: "Air quality"
    type: ranged_value
    value: "{{ air.current.european_aqi }}"
    title: "AQI"
    icon: leaf
    min: 0
    max: 100
    screen: air
