chore(nightscout): add all object properties

This commit is contained in:
Jan De Dobbeleer 2021-11-25 08:57:47 +01:00 committed by Jan De Dobbeleer
parent 1075b82e10
commit 30c82c2f56
2 changed files with 21 additions and 2 deletions

View file

@ -79,7 +79,16 @@ if that color is visible against any of your backgrounds.
## Template Properties ## Template Properties
- .ID: `string` - The internal ID of the object
- .Sgv: `int` - Your Serum Glucose Value (your sugar) - .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 - .TrendIcon: `string` - By default, this will be something like ↑↑ or ↘ etc but you can
override them with any glpyh as seen above override them with any glpyh as seen above

View file

@ -3,6 +3,7 @@ package main
import ( import (
"encoding/json" "encoding/json"
"errors" "errors"
"time"
) )
// segment struct, makes templating easier // segment struct, makes templating easier
@ -31,8 +32,17 @@ const (
// NightscoutData struct contains the API data // NightscoutData struct contains the API data
type NightscoutData struct { type NightscoutData struct {
Sgv int64 `json:"sgv"` ID string `json:"_id"`
Direction string `json:"direction"` Sgv int `json:"sgv"`
Date int64 `json:"date"`
DateString time.Time `json:"dateString"`
Trend int `json:"trend"`
Direction string `json:"direction"`
Device string `json:"device"`
Type string `json:"type"`
UtcOffset int `json:"utcOffset"`
SysTime time.Time `json:"sysTime"`
Mills int64 `json:"mills"`
} }
func (ns *nightscout) enabled() bool { func (ns *nightscout) enabled() bool {