Nightscout
Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →
Qué hace
Nightscout (CGM en la Nube) es un proyecto de código abierto y DIY que permite el acceso en tiempo real a datos de CGM mediante una API REST HTTP. Se utiliza para visualizar de forma remota y segura datos de glucosa desde cualquier lugar... ¡incluyendo segmentos de Oh My Posh en la línea de comandos!
Configuración de ejemplo
Este ejemplo utiliza mg/dl por defecto porque la API de Nightscout envía el valor de glucosa (.Sgv) en formato mg/dl. A continuación también encontrarás una plantilla para mostrar el valor de glucosa en mmol/L. Cuando uses diferentes rangos de colores, debes multiplicar tus valores altos y bajos de glucosa por 18 y usar estos valores en las plantillas. También deberás considerar los colores de fondo y primer plano. Por ejemplo, evita usar texto blanco sobre fondo amarillo.
El ejemplo de foreground_templates a continuación podría configurarse con un solo color,
si ese color es visible sobre cualquiera de tus fondos.
- json
- yaml
- toml
{
"type": "nightscout",
"style": "diamond",
"foreground": "#ffffff",
"background": "#ff0000",
"background_templates": [
"{{ if gt .Sgv 150 }}#FFFF00{{ end }}",
"{{ if lt .Sgv 60 }}#FF0000{{ end }}",
"#00FF00"
],
"foreground_templates": [
"{{ if gt .Sgv 150 }}#000000{{ end }}",
"{{ if lt .Sgv 60 }}#000000{{ end }}",
"#000000"
],
"leading_diamond": "",
"trailing_diamond": "",
"template": " {{ .Sgv }}{{ .TrendIcon }}",
"options": {
"url": "https://YOURNIGHTSCOUTAPP.herokuapp.com/api/v1/entries.json?count=1&token=APITOKENFROMYOURADMIN",
"http_timeout": 1500
}
}
type: nightscout
style: diamond
foreground: "#ffffff"
background: "#ff0000"
background_templates:
- "{{ if gt .Sgv 150 }}#FFFF00{{ end }}"
- "{{ if lt .Sgv 60 }}#FF0000{{ end }}"
- "#00FF00"
foreground_templates:
- "{{ if gt .Sgv 150 }}#000000{{ end }}"
- "{{ if lt .Sgv 60 }}#000000{{ end }}"
- "#000000"
leading_diamond:
trailing_diamond:
template: {{ .Sgv }}{{ .TrendIcon }}
options:
url: https://YOURNIGHTSCOUTAPP.herokuapp.com/api/v1/entries.json?count=1&token=APITOKENFROMYOURADMIN
http_timeout: 1500
type = "nightscout"
style = "diamond"
foreground = "#ffffff"
background = "#ff0000"
background_templates = [ "{{ if gt .Sgv 150 }}#FFFF00{{ end }}", "{{ if lt .Sgv 60 }}#FF0000{{ end }}", "#00FF00" ]
foreground_templates = [ "{{ if gt .Sgv 150 }}#000000{{ end }}", "{{ if lt .Sgv 60 }}#000000{{ end }}", "#000000" ]
leading_diamond = ""
trailing_diamond = ""
template = " {{ .Sgv }}{{ .TrendIcon }}"
[options]
url = "https://YOURNIGHTSCOUTAPP.herokuapp.com/api/v1/entries.json?count=1&token=APITOKENFROMYOURADMIN"
http_timeout = 1500
O muestra en mmol/l (en lugar del predeterminado mg/dl) con la siguiente plantilla:
- json
- yaml
- toml
{
"template": " {{ if eq (mod .Sgv 18) 0 }}{{divf .Sgv 18}}.0{{ else }} {{ round (divf .Sgv 18) 1 }}{{ end }}{{ .TrendIcon }}"
}
template: {{ if eq (mod .Sgv 18) 0 }}{{divf .Sgv 18}}.0{{ else }} {{ round
(divf .Sgv 18) 1 }}{{ end }}{{ .TrendIcon }}
template = " {{ if eq (mod .Sgv 18) 0 }}{{divf .Sgv 18}}.0{{ else }} {{ round (divf .Sgv 18) 1 }}{{ end }}{{ .TrendIcon }}"
Opciones
| Name | Type | Default | Description |
|---|---|---|---|
url | template | Your Nightscout URL, including the full path to entries.json AND count=1 AND token. Example above. You'll know this works if you can curl it yourself and get a single value | |
headers | map[string]string | A key, value map of Headers to send with the request | |
http_timeout | int | 20 | in milliseconds - how long do you want to wait before you want to see your prompt more than your sugar? I figure a half second is a good default |
¡Puedes cambiar los iconos de tendencia, colocar la tendencia en otro lugar, añadir texto, como prefieras! Asegúrate de que tu NerdFont incluya el glifo que deseas o busca uno.
| Icono | Descripción |
|---|---|
DoubleUpIcon | por defecto ↑↑ |
SingleUpIcon | por defecto ↑ |
FortyFiveUpIcon | por defecto ↗ |
FlatIcon | por defecto → |
FortyFiveDownIcon | por defecto ↘ |
SingleDownIcon | por defecto ↓ |
DoubleDownIcon | por defecto ↓↓ |
Plantilla (info)
{{ .Sgv }}
Propiedades
| Name | Type | Description |
|---|---|---|
.ID | string | The internal ID of the object |
.Sgv | int | Your Serum Glucose Value (your sugar) |
.Date | int | The unix timestamp of the entry |
.DateString | time | The timestamp of the entry |
.Trend | int | The trend of the entry |
.Device | string | The device linked to the entry |
.Type | string | The type of the entry |
.UtcOffset | int | The UTC offset |
.SysTime | time | The time on the system |
.Mills | int | The amount of mills |
.TrendIcon | string | By default, this will be something like ↑↑ or ↘ etc but you can override them with any glyph as seen above |