# YAML de configuration du service Weatherbit.io (weatherbit)
# -----------------------------------------------------------------------------------------------
# Il est composé de 5 blocs, à savoir :
# - service    : la configuration du service lui-même, son titre, son id, ses caractéristiques...
# - infos      : la configuration du mash-up pour les informations sur le lieu de la météo
# - conditions : la configuration du mash-up pour les conditions temps réel
# - previsions : la configuration du mash-up pour les prévisions
# - erreurs    : la configuration du mash-up pour les erreurs fournies par le service
#
# Si un champ vaut la valeur par défaut il est possible de l'omettre.
# -----------------------------------------------------------------------------------------------

# Bloc service : caractéristiques du service
# ------------------------------------------
service:
  nom: 'Weatherbit.io'
  # -- Version de la configuration du service
  version:
    numero: '5'
    date: '2023-11-18'
  # -- URL de base des requêtes et des icones (éventuellement)
  endpoint_requete: 'https://api.weatherbit.io/v2.0/'
  endpoint_icone: 'https://www.weatherbit.io/static/img/icons/'
  lieu_formats: [ 'latitude_longitude', 'ville_pays', 'city_id' ]
  # -- Activité: par défaut à true, donc à laisser en commentaire. A mettre à false si on veut déprécier le service
  actif: true
  # -- Liens vers les crédits et titre de la page (pour les affichages / modèles)
  #    Le logo, si il existe, est chargé automatiquement à partir du chemin /services/images/<id>.png
  credits:
    titre: 'Weatherbit API'
    lien: 'https://www.weatherbit.io/'
  termes:
    titre: 'Terms of Service'
    lien: 'https://www.weatherbit.io/terms'
  enregistrement:
    titre: 'Sign up for the Weatherbit API!'
    lien: 'https://www.weatherbit.io/account/create'
    #taille_cle: 32
  offres:
    titre: 'Weather API - Pricing'
    lien: 'https://www.weatherbit.io/pricing'
    #gratuite: true
    limites: { day: 500, second: 1 }
  langues:
    codes_spip: ['ar', 'az', 'be', 'bg', 'bs', 'ca', 'da', 'de', 'el', 'en', 'es', 'et', 'fi', 'fr', 'hr', 'hu', 'id', 'is', 'it', 'lt', 'nb', 'nl', 'pl', 'pt', 'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'tr', 'zh', 'zh_tw']
    codes_non_spip: { cz: 'cs', iw: 'he', kw: '' }
    defaut: 'en'
  # -- Configuration des jeux d'icones utilisables
  icones:
    origines: [ 'api', 'local', 'weather' ]
    transcodages:
      200: { local: [ 't01d', 't01n' ], weather: [ '3', '3' ], wmo: [ ] }
      201: { local: [ 't02d', 't02n' ], weather: [ '3', '3' ], wmo: [ ] }
      202: { local: [ 't03d', 't03n' ], weather: [ '3', '3' ], wmo: [ ] }
      230: { local: [ 't04d', 't04n' ], weather: [ '3', '3' ], wmo: [ ] }
      231: { local: [ 't04d', 't04n' ], weather: [ '3', '3' ], wmo: [ ] }
      232: { local: [ 't04d', 't04n' ], weather: [ '3', '3' ], wmo: [ ] }
      233: { local: [ 't05d', 't05n' ], weather: [ '17', '17' ], wmo: [ ] }
      300: { local: [ 'd01d', 'd01n' ], weather: [ '9', '9' ], wmo: [ ] }
      301: { local: [ 'd02d', 'd02n' ], weather: [ '9', '9' ], wmo: [ ] }
      302: { local: [ 'd03d', 'd03n' ], weather: [ '9', '9' ], wmo: [ ] }
      500: { local: [ 'r01d', 'r01n' ], weather: [ '12', '12' ], wmo: [ ] }
      501: { local: [ 'r02d', 'r02n' ], weather: [ '12', '12' ], wmo: [ ] }
      502: { local: [ 'r03d', 'r03n' ], weather: [ '40', '40' ], wmo: [ ] }
      511: { local: [ 'f01d', 'f01n' ], weather: [ '10', '10' ], wmo: [ ] }
      520: { local: [ 'r04d', 'r04n' ], weather: [ '11', '11' ], wmo: [ ] }
      521: { local: [ 'r05d', 'r05n' ], weather: [ '11', '11' ], wmo: [ ] }
      522: { local: [ 'r06d', 'r06n' ], weather: [ '11', '11' ], wmo: [ ] }
      600: { local: [ 's01d', 's01n' ], weather: [ '14', '14' ], wmo: [ ] }
      601: { local: [ 's02d', 's02n' ], weather: [ '16', '16' ], wmo: [ ] }
      602: { local: [ 's03d', 's03n' ], weather: [ '42', '42' ], wmo: [ ] }
      610: { local: [ 's04d', 's04n' ], weather: [ '5', '5' ], wmo: [ ] }
      611: { local: [ 's05d', 's05n' ], weather: [ '18', '18' ], wmo: [ ] }
      612: { local: [ 's05d', 's05n' ], weather: [ '18', '18' ], wmo: [ ] }
      621: { local: [ 's01d', 's01n' ], weather: [ '16', '16' ], wmo: [ ] }
      622: { local: [ 's02d', 's02n' ], weather: [ '16', '16' ], wmo: [ ] }
      623: { local: [ 's06d', 's06n' ], weather: [ '13', '13' ], wmo: [ ] }
      700: { local: [ 'a01d', 'a01n' ], weather: [ '21', '21' ], wmo: [ ] }
      711: { local: [ 'a02d', 'a02n' ], weather: [ '22', '22' ], wmo: [ ] }
      721: { local: [ 'a03d', 'a03n' ], weather: [ '21', '21' ], wmo: [ ] }
      731: { local: [ 'a04d', 'a04n' ], weather: [ '19', '19' ], wmo: [ ] }
      741: { local: [ 'a05d', 'a05n' ], weather: [ '20', '20' ], wmo: [ ] }
      751: { local: [ 'a06d', 'a06n' ], weather: [ '20', '20' ], wmo: [ ] }
      800: { local: [ 'c01d', 'c01n' ], weather: [ '32', '31' ], wmo: [ ] }
      801: { local: [ 'c02d', 'c02n' ], weather: [ '34', '33' ], wmo: [ ] }
      802: { local: [ 'c02d', 'c02n' ], weather: [ '34', '33' ], wmo: [ ] }
      803: { local: [ 'c03d', 'c03n' ], weather: [ '28', '27' ], wmo: [ ] }
      804: { local: [ 'c04d', 'c04n' ], weather: [ '26', '26' ], wmo: [ ] }
      900: { local: [ 'u00d', 'u00n' ], weather: [ 'na', 'na' ], wmo: [ ] }
  defauts:
    #inscription: ''
    #unite: 'm'
    #condition: 'weatherbit'
    theme: ''
    theme_local: 'original'
    #theme_weather: 'sticker'

# Bloc Infos (mashup des information géographiques)
# -------------------------------------------------
infos:
  #periode_maj: 2592000
  #format_flux: 'json'
  cle_base: ['data', 0]
  donnees:
    ville:
      cle: ['city_name']
    pays:
      cle: [ ]
    pays_iso2:
      cle: ['country_code']
    region:
      cle: [ ]
    longitude:
      cle: ['lon']
    latitude:
      cle: ['lat']

# Bloc Conditions (mashup des conditions temps réel)
# --------------------------------------------------
conditions:
  periode_maj: 10800
  #format_flux: 'json'
  cle_base: [ 'data', 0 ]
  donnees:
    derniere_maj:
      cle: ['ob_time']
    station:
      cle: [ ]
    temperature_reelle:
      cle: ['temp']
    temperature_ressentie:
      cle: ['app_temp']
    vitesse_vent:
      cle: ['wind_spd']
    rafale_vent:
      cle: ['gust']
    angle_vent:
      cle: ['wind_dir']
    direction_vent:
      cle: [ ]
      calcul: true
    precipitation:
      cle: ['precip']
    humidite:
      cle: ['rh']
    point_rosee:
      cle: ['dewpt']
    pression:
      cle: ['pres']
    tendance_pression:
      cle: [ ]
    visibilite:
      cle: ['vis']
    nebulosite:
      cle: ['clouds']
    indice_uv:
      cle: ['uv']
    risque_uv:
      cle: [ ]
      calcul: true
    code_meteo:
      cle: ['weather', 'code']
    icon_meteo:
      cle: ['weather', 'icon']
    desc_meteo:
      cle: ['weather', 'description']
    trad_meteo:
      cle: [ ]
    jour_meteo:
      cle: ['pod']
    code:
      cle: [ ]
      calcul: true
    icone:
      cle: [ ]
      calcul: true
    resume:
      cle: [ ]
      calcul: true
    periode:
      cle: [ ]
      calcul: true

# Bloc Prévisions (mashup des prévisions)
# ---------------------------------------
previsions:
  #periode_maj: 14400
  #format_flux: 'json'
  periodicites:
    24: { max_jours: 16 }
    3: { max_jours: 5 }
    1: { max_jours: 5 }
  periodicite_defaut: 24
  cle_base: ['data']
  cle_heure: [ ]
  structure_heure: false
  donnees:
    date:
      cle: ['valid_date']
    heure:
      cle: [ ]
    lever_soleil:
      cle: [ ]
    coucher_soleil:
      cle: [ ]
    temperature:
      cle: ['temp']
    temperature_max:
      cle: ['max_temp']
    temperature_min:
      cle: ['min_temp']
    vitesse_vent:
      cle: ['wind_spd']
    rafale_vent:
      cle: ['wind_gust_spd']
    angle_vent:
      cle: ['wind_dir']
    direction_vent:
      cle: [ ]
      calcul: true
    risque_precipitation:
      cle: ['pop']
    precipitation:
      cle: ['precip']
    humidite:
      cle: ['rh']
    point_rosee:
      cle: ['dewpt']
    pression:
      cle: ['pres']
    visibilite:
      cle: ['vis']
    nebulosite:
      cle: ['clouds']
    indice_uv:
      cle: ['uv']
    risque_uv:
      cle: [ ]
      calcul: true
    code_meteo:
      cle: ['weather', 'code']
    icon_meteo:
      cle: ['weather', 'icon']
    desc_meteo:
      cle: ['weather', 'description']
    trad_meteo:
      cle: [ ]
    jour_meteo:
      cle: [ ]
    code:
      cle: [ ]
      calcul: true
    icone:
      cle: [ ]
      calcul: true
    resume:
      cle: [ ]
      calcul: true
    periode:
      cle: [ ]
      calcul: true

erreurs:
  cle_base: [ ]
  donnees:
    code:
      cle: [ ]
    message:
      cle: [ 'error' ]
