# YAML d'initialisation de la configuration du service Accuweather (accuweather)
# -----------------------------------------------------------------------------------------------
# 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 (souvent en commentaire).
# -----------------------------------------------------------------------------------------------

# Bloc service : caractéristiques du service
# ------------------------------------------
service:
  nom: 'AccuWeather'
  # -- 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: 'http://dataservice.accuweather.com/'
  endpoint_icone: ''
  lieu_formats: [ '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: 'AccuWeather'
    lien: 'https://www.accuweather.com/'
  termes:
    titre: 'Terms of Use'
    lien: 'https://developer.accuweather.com/legal'
  enregistrement:
    titre: 'User Account'
    lien: 'https://developer.accuweather.com/user/register'
    #taille_cle: 32
  offres:
    titre: 'Packages'
    lien: 'https://developer.accuweather.com/packages'
    #gratuite: true
    limites: { day: 50 }
  langues:
    codes_spip: [ 'ar', 'az', 'bn', 'bs', 'bg', 'ca', 'zh', 'hr', 'cs', 'da', 'nl', 'en', 'es', 'et', 'fa', 'fi', 'fr', 'de', 'el', 'gu', 'he', 'hi', 'hu', 'is', 'id', 'it', 'ja', 'kn', 'kk', 'ko', 'lv', 'lt', 'mk', 'ms', 'mr', 'nb', 'pl', 'pt', 'pa', 'ro', 'ru', 'sr', 'sk', 'sl', 'sw', 'sv', 'tl', 'ta', 'te', 'th', 'tr', 'uk', 'ur', 'uz', 'vi' ]
    codes_non_spip: { fil: '', zh-tw: 'zh_tw' }
    defaut: 'en'
  # -- Configuration des jeux d'icones utilisables
  icones:
    origines: [ 'local', 'weather' ]
    transcodages:
      1: { local: [ '1', '' ], weather: [ '32', '' ], wmo: [ ] }
      2: { local: [ '2', '' ], weather: [ '34', '' ], wmo: [ ] }
      3: { local: [ '3', '' ], weather: [ '30', '' ], wmo: [ ] }
      4: { local: [ '4', '' ], weather: [ '30', '' ], wmo: [ ] }
      5: { local: [ '5', '' ], weather: [ '21', '' ], wmo: [ ] }
      6: { local: [ '6', '' ], weather: [ '28', '' ], wmo: [ ] }
      7: { local: [ '7', '7' ], weather: [ '26', '26' ], wmo: [ ] }
      8: { local: [ '8', '8' ], weather: [ '26', '26' ], wmo: [ ] }
      11: { local: [ '11', '11' ], weather: [ '20', '20' ], wmo: [ ] }
      12: { local: [ '12', '12' ], weather: [ '11', '11' ], wmo: [ ] }
      13: { local: [ '13', '' ], weather: [ '39', '' ], wmo: [ ] }
      14: { local: [ '14', '' ], weather: [ '39', '' ], wmo: [ ] }
      15: { local: [ '15', '15' ], weather: [ '4', '4' ], wmo: [ ] }
      16: { local: [ '16', '' ], weather: [ '38', '' ], wmo: [ ] }
      17: { local: [ '17', '' ], weather: [ '37', '' ], wmo: [ ] }
      18: { local: [ '18', '18' ], weather: [ '12', '12' ], wmo: [ ] }
      19: { local: [ '19', '19' ], weather: [ '13', '13' ], wmo: [ ] }
      20: { local: [ '20', '' ], weather: [ '41', '' ], wmo: [ ] }
      21: { local: [ '21', '' ], weather: [ '41', '' ], wmo: [ ] }
      22: { local: [ '22', '22' ], weather: [ '16', '16' ], wmo: [ ] }
      23: { local: [ '23', '' ], weather: [ '41', '' ], wmo: [ ] }
      24: { local: [ '24', '24' ], weather: [ '17', '17' ], wmo: [ ] }
      25: { local: [ '25', '25' ], weather: [ '18', '18' ], wmo: [ ] }
      26: { local: [ '26', '26' ], weather: [ '10', '10' ], wmo: [ ] }
      29: { local: [ '29', '29' ], weather: [ '5', '5' ], wmo: [ ] }
      30: { local: [ '30', '30' ], weather: [ '36', '36' ], wmo: [ ] }
      31: { local: [ '31', '31' ], weather: [ '25', '25' ], wmo: [ ] }
      32: { local: [ '32', '32' ], weather: [ '24', '24' ], wmo: [ ] }
      33: { local: [ '', '33' ], weather: [ '', '31' ], wmo: [ ] }
      34: { local: [ '', '34' ], weather: [ '', '33' ], wmo: [ ] }
      35: { local: [ '', '35' ], weather: [ '', '29' ], wmo: [ ] }
      36: { local: [ '', '36' ], weather: [ '', '29' ], wmo: [ ] }
      37: { local: [ '', '37' ], weather: [ '', '21' ], wmo: [ ] }
      38: { local: [ '', '38' ], weather: [ '', '27' ], wmo: [ ] }
      39: { local: [ '', '39' ], weather: [ '', '45' ], wmo: [ ] }
      40: { local: [ '', '40' ], weather: [ '', '45' ], wmo: [ ] }
      41: { local: [ '', '41' ], weather: [ '', '47' ], wmo: [ ] }
      42: { local: [ '', '42' ], weather: [ '', '47' ], wmo: [ ] }
      43: { local: [ '', '43' ], weather: [ '', '46' ], wmo: [ ] }
      44: { local: [ '', '44' ], weather: [ '', '46' ], wmo: [ ] }
  defauts:
    #inscription: ''
    #unite: 'm'
    condition: 'accuweather_local'
    theme: ''
    theme_local: 'original'
    #theme_weather: 'sticker'
    #theme_wmo: 'symbols'

# Bloc Infos (mashup des information géographiques)
# -------------------------------------------------
infos:
  #periode_maj: 2592000
  #format_flux: 'json'
  cle_base: [ ]
  donnees:
    ville:
      cle: [ 'LocalizedName' ]
    pays:
      cle: [ 'Country', 'LocalizedName' ]
    pays_iso2:
      cle: [ 'Country', 'ID' ]
    region:
      cle: [ 'Region', 'LocalizedName' ]
    longitude:
      cle: [ 'GeoPosition', 'Longitude' ]
    latitude:
      cle: [ 'GeoPosition', 'Latitude' ]

# Bloc Conditions (mashup des conditions temps réel)
# --------------------------------------------------
conditions:
  #periode_maj: 7200
  #format_flux: 'json'
  cle_base: [ 0 ]
  donnees:
    derniere_maj:
      cle: [ 'LocalObservationDateTime' ]
    station:
      cle: [ 'LocalSource', 'Name']
    temperature_reelle:
      cle: [ 'Temperature', '', 'Value' ]
      suffixe_unite: { id_cle: 1, m: 'Metric', s: 'Imperial' }
    temperature_ressentie:
      cle: [ 'ApparentTemperature', '', 'Value' ]
      suffixe_unite: { id_cle: 1, m: 'Metric', s: 'Imperial' }
    vitesse_vent:
      cle: [ 'Wind', 'Speed', '', 'Value' ]
      suffixe_unite: { id_cle: 2, m: 'Metric', s: 'Imperial' }
    rafale_vent:
      cle: [ 'WindGust', 'Speed', '', 'Value' ]
      suffixe_unite: { id_cle: 2, m: 'Metric', s: 'Imperial' }
    angle_vent:
      cle: [ 'Wind', 'Direction', 'Degrees' ]
    direction_vent:
      cle: [ 'Wind', 'Direction', 'English' ]
    precipitation:
      cle: [ 'Precip1hr', '', 'Value' ]
      suffixe_unite: { id_cle: 1, m: 'Metric', s: 'Imperial' }
    humidite:
      cle: [ 'RelativeHumidity' ]
    point_rosee:
      cle: [ 'DewPoint', '', 'Value' ]
      suffixe_unite: { id_cle: 1, m: 'Metric', s: 'Imperial' }
    pression:
      cle: [ 'Pressure', '', 'Value' ]
      suffixe_unite: { id_cle: 1, m: 'Metric', s: 'Imperial' }
    tendance_pression:
      cle: [ 'PressureTendency', 'Code' ]
    visibilite:
      cle: [ 'Visibility', '', 'Value' ]
      suffixe_unite: { id_cle: 1, m: 'Metric', s: 'Imperial' }
    nebulosite:
      cle: [ 'CloudCover' ]
    indice_uv:
      cle: [ 'UVIndex' ]
    risque_uv:
      cle: [ ]
      calcul: true
    code_meteo:
      cle: [ 'WeatherIcon' ]
    icon_meteo:
      cle: [ ]
    desc_meteo:
      cle: [ 'WeatherText' ]
    trad_meteo:
      cle: [ ]
    jour_meteo:
      cle: [ 'IsDayTime' ]
    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:
    12: { max_jours: 5 }
  periodicite_defaut: 12
  cle_base: [ 'DailyForecasts' ]
  # La clé heure est construite (fonction accuweather_flux2service) car elle n'est pas conforme à ce qui est attendu par le mash-up
  cle_heure: [ 'Hourly' ]
  structure_heure: true
  donnees:
    date:
      cle: [ 'Date' ]
    heure:
      cle: [ ]
    lever_soleil:
      cle: [ 'Sun', 'Rise' ]
    coucher_soleil:
      cle: [ 'Sun', 'Set' ]
    temperature:
      cle: [ ]
    temperature_max:
      cle: [ 'Temperature', 'Maximum', 'Value' ]
    temperature_min:
      cle: [ 'Temperature', 'Minimum', 'Value' ]
    vitesse_vent:
      cle: [ 'Wind', 'Speed', 'Value' ]
    rafale_vent:
      cle: [ 'WindGust', 'Speed', 'Value' ]
    angle_vent:
      cle: [ 'Wind', 'Direction', 'Degrees' ]
    direction_vent:
      cle: [ 'Wind', 'Direction', 'English' ]
    risque_precipitation:
      cle: [ 'PrecipitationProbability' ]
    precipitation:
      cle: [ 'TotalLiquid', 'Value' ]
    humidite:
      cle: [ ]
    point_rosee:
      cle: [ ]
    pression:
      cle: [ ]
    visibilite:
      cle: [ ]
    nebulosite:
      cle: [ 'CloudCover' ]
    indice_uv:
      cle: [ ]
    risque_uv:
      cle: [ ]
    code_meteo:
      cle: [ 'Icon' ]
    icon_meteo:
      cle: [ ]
    desc_meteo:
      cle: [ 'IconPhrase' ]
    trad_meteo:
      cle: [ ]
    jour_meteo:
      cle: [ ]
    code:
      cle: [ ]
      calcul: true
    icone:
      cle: [ ]
      calcul: true
    resume:
      cle: [ ]
      calcul: true
    periode:
      cle: [ ]
      calcul: true

# Bloc Erreurs (mashup des erreurs du service)
# --------------------------------------------
erreurs:
  cle_base: [ ]
  donnees:
    code:
      cle: [ 'Code' ]
    message:
      cle: [ 'Message' ]
