OpenWeatherMap
Traducción Beta No Oficial
Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →
Qué hace
Muestra el tiempo actual de una ubicación determinada mediante OpenWeatherMap.
precaución
Debes solicitar una clave de API en el sitio web de OpenWeatherMap. El plan gratuito para Current weather and forecasts collection es suficiente.
Configuración de ejemplo
- json
- yaml
- toml
{
"type": "owm",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#ffffff",
"background": "#FF0000",
"template": "{{.Weather}} ({{.Temperature}}{{.UnitIcon}})",
"options": {
"api_key": "<YOUR_API_KEY>",
"location": "AMSTERDAM,NL",
"units": "metric",
"http_timeout": 20
}
}
type: owm
style: powerline
powerline_symbol:
foreground: "#ffffff"
background: "#FF0000"
template: "{{.Weather}} ({{.Temperature}}{{.UnitIcon}})"
options:
api_key: <YOUR_API_KEY>
location: AMSTERDAM,NL
units: metric
http_timeout: 20
type = "owm"
style = "powerline"
powerline_symbol = ""
foreground = "#ffffff"
background = "#FF0000"
template = "{{.Weather}} ({{.Temperature}}{{.UnitIcon}})"
[options]
api_key = "<YOUR_API_KEY>"
location = "AMSTERDAM,NL"
units = "metric"
http_timeout = 20
Opciones
| Name | Type | Default | Description |
|---|---|---|---|
api_key | template | . | Your API key from Open Weather Map. |
location | template | De Bilt,NL | The requested location interpreted only if valid coordinates aren't given. Formatted as <City,STATE,COUNTRY_CODE>. City name, state code and country code divided by comma. Please, refer to ISO 3166 for the state codes or country codes . |
units | string | standard | Units of measurement. Available values are standard (kelvin), metric (celsius), and imperial (fahrenheit) |
http_timeout | int | 20 | in milliseconds, the timeout for http request |
Plantilla (info)
plantilla predeterminada
{{ .Weather }} ({{ .Temperature }}{{ .UnitIcon }})
Propiedades
| Name | Type | Description |
|---|---|---|
.Weather | string | the current weather icon |
.Temperature | int | the current temperature |
.UnitIcon | string | the current unit icon(based on units property) |
.URL | string | the url of the current api call |