Saltar al contenido principal

Intensidad de carbono

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 la intensidad de carbono actual y prevista en gCO₂/kWh utilizando datos de la Carbon Intensity API.

nota

Actualmente, este segmento solo proporciona datos para Gran Bretaña. Es posible que en el futuro se añada soporte para otros países.

Configuración de ejemplo

precaución

La API puede ser lenta. Se recomienda establecer la propiedad http_timeout con un valor alto (por ejemplo, 5000).

{
"type": "carbonintensity",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#000000",
"background": "#ffffff",
"background_templates": [
"{{if eq \"very low\" .Index}}#a3e635{{end}}",
"{{if eq \"low\" .Index}}#bef264{{end}}",
"{{if eq \"moderate\" .Index}}#fbbf24{{end}}",
"{{if eq \"high\" .Index}}#ef4444{{end}}",
"{{if eq \"very high\" .Index}}#dc2626{{end}}"
],
"template": " CO₂ {{ .Index.Icon }}{{ .Actual.String }} {{ .TrendIcon }} {{ .Forecast.String }} ",
"options": {
"http_timeout": 5000
}
}

Opciones

NameTypeDefaultDescription
http_timeoutint20Timeout (in milliseconds) for HTTP requests. The default is 20ms, but you may need to set this to as high as 5000ms to handle slow API requests.

Plantilla (info)

plantilla predeterminada
 CO₂ {{ .Index.Icon }}{{ .Actual.String }} {{ .TrendIcon }} {{ .Forecast.String }}

Propiedades

NameTypeDescription
.ForecastNumberThe forecast carbon intensity in gCO2/kWh. Equal to 0 if no data is available.
.ActualNumberThe actual carbon intensity in gCO2/kWh. Equal to 0 if no data is available.
.IndexIndexA rating of the current carbon intensity. Possible values are "very low", "low", "moderate", "high", or "very high". Equal to "??" if no data is available.
.TrendIconstringAn icon representation of the predicted trend in carbon intensity based on the Actual and Forecast values. Possible values are "↗", "↘", or "→".

Número

NameTypeDescription
.Stringstringstring representation of the value

Índice

NameTypeDescription
.Iconstringicon representation of the value