Aller au contenu principal

Nightscout

Traduction Bêta Non Officielle

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.

{
"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 :

{
"template": " {{ if eq (mod .Sgv 18) 0 }}{{divf .Sgv 18}}.0{{ else }} {{ round (divf .Sgv 18) 1 }}{{ end }}{{ .TrendIcon }}"
}

Options

NameTypeDefaultDescription
urltemplateYour 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
headersmap[string]stringA key, value map of Headers to send with the request
http_timeoutint20in 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
info

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.

IconDescription
DoubleUpIconpar défaut : ↑↑
SingleUpIconpar défaut :
FortyFiveUpIconpar défaut :
FlatIconpar défaut :
FortyFiveDownIconpar défaut :
SingleDownIconpar défaut :
DoubleDownIconpar défaut : ↓↓

Modèle (info)

modèle par défaut
 {{ .Sgv }}

Propriétés

NameTypeDescription
.IDstringThe internal ID of the object
.SgvintYour Serum Glucose Value (your sugar)
.DateintThe unix timestamp of the entry
.DateStringtimeThe timestamp of the entry
.TrendintThe trend of the entry
.DevicestringThe device linked to the entry
.TypestringThe type of the entry
.UtcOffsetintThe UTC offset
.SysTimetimeThe time on the system
.MillsintThe amount of mills
.TrendIconstringBy default, this will be something like ↑↑ or ↘ etc but you can override them with any glyph as seen above