Nightscout
Cette page a été traduite par PageTurner AI (bêta). Non approuvée officiellement par le projet. Vous avez trouvé une erreur ? Signaler un problème →
Description
Nightscout (CGM in the Cloud) est un projet open source et DIY qui permet d'accéder en temps réel aux données d'un CGM via une API REST HTTP. Il sert à visualiser à distance et de manière sécurisée les données glycémiques depuis n'importe où... y compris dans les segments Oh My Posh sur la ligne de commande !
Exemple de configuration
Cet exemple utilise mg/dl par défaut car l'API Nightscout envoie la valeur glycémique (.Sgv) au format mg/dl. Vous trouverez ci-dessous un modèle pour afficher la valeur en mmol/L. Lorsque vous utilisez différentes plages de couleurs, multipliez vos valeurs glycémiques haute et basse par 18 et utilisez ces valeurs dans les modèles. Pensez également à vos couleurs d'arrière-plan et de premier plan. Par exemple, évitez le texte blanc sur fond jaune.
L'exemple foreground_templates ci-dessous peut être configuré avec une seule couleur,
à condition qu'elle soit visible sur tous vos arrière-plans.
- 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
Ou affichez en mmol/l (au lieu du mg/dl par défaut) avec ce modèle :
- 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 }}"
Options
| 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 |
Vous pouvez personnaliser les icônes de tendance, déplacer la tendance, ajouter du texte - faites comme vous voulez ! Vérifiez que votre NerdFont contient le glyphe souhaité ou recherchez-en un.
| Icon | Description |
|---|---|
DoubleUpIcon | par défaut : ↑↑ |
SingleUpIcon | par défaut : ↑ |
FortyFiveUpIcon | par défaut : ↗ |
FlatIcon | par défaut : → |
FortyFiveDownIcon | par défaut : ↘ |
SingleDownIcon | par défaut : ↓ |
DoubleDownIcon | par défaut : ↓↓ |
Modèle (info)
{{ .Sgv }}
Propriétés
| 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 |