feat(brewfather): new fields, fixes

add batch fields
update doc with new fields and fix ref to .DefaultString
complete schema definition
This commit is contained in:
memcpy-rand-rand-rand 2021-12-16 09:55:47 +00:00 committed by Jan De Dobbeleer
parent e62d242860
commit 89ece8d68a
3 changed files with 94 additions and 4 deletions

View file

@ -81,6 +81,8 @@ Commonly used fields
- .DaysBottled `int` - days since bottled/kegged
- .DaysBottledOrFermented `int` - one of the above, chosen automatically based on batch status
- .Recipe.Name: `string` - The recipe being brewed in this batch
- .BatchName `string` - The name of this batch
- .BatchNumer `int` - The number of this batch
- .MeasuredAbv: `float` - The ABV for the batch - either estimated from recipe or calculated from entered OG and FG values
- .ReadingAge `int` - age in hours of most recent reading or -1 if there are no readings available
@ -107,8 +109,7 @@ Additional template properties
Hyperlink support
- .URL `string` - the URL for the batch in the Brewfather app. You can use this to add a hyperlink to the segment
if you are using a terminal that supports it and the segment has `"enable_hyperlink":true` in it's properties. `.DefaultString`
has this by default.
if you are using a terminal that supports it. The default template implements this.
Hyperlink formatting example

View file

@ -76,8 +76,10 @@ type BatchReading struct {
}
type Batch struct {
// Json tagged values returned from https://api.brewfather.app/v1/batches/batch_id
Status string `json:"status"`
Recipe struct {
Status string `json:"status"`
BatchName string `json:"name"`
BatchNumber int `json:"batchNo"`
Recipe struct {
Name string `json:"name"`
} `json:"recipe"`
BrewDate int64 `json:"brewDate"`

View file

@ -1837,6 +1837,93 @@
"title":"Icon to use to indicate days",
"description":"Appended to a number to indicate days, e.g. 25d",
"default":"d"
},
"http_timeout": {
"$ref": "#/definitions/http_timeout"
},
"cache_timeout": {
"type": "integer",
"title": "cache timeout in minutes",
"description": "The number of minutes the response is cached. A value of 0 disables the cache.",
"default": 5
},
"doubleup_icon": {
"type":"string",
"title":"Temperature trend icon, very high positive change",
"description":"Delta between this and prior temperature reading is very high (> 4C by default), available intemplate as .TemperatureTrend",
"default":"↑↑"
},
"singleup_icon": {
"type":"string",
"title":"Temperature trend icon, high positive change",
"description":"Delta between this and prior temperature reading is high (2C < delta < 4C by default), available intemplate as .TemperatureTrend",
"default":"↑"
},
"fortyfiveup_icon": {
"type":"string",
"title":"Temperature trend icon, positive change",
"description":"Delta between this and prior temperature reading is positive (0.5C < delta < 2C by default), available intemplate as .TemperatureTrend",
"default":"↗"
},
"flat_icon": {
"type":"string",
"title":"Temperature trend icon, flat/small change",
"description":"Delta between this and prior temperature and this temperature reading (< +-0.5C change), available intemplate as .TemperatureTrend",
"default":"→"
},
"fortyfivedown_icon": {
"type":"string",
"title":"Temperature trend icon, v. negative change",
"description":"Delta between this and prior temperature reading is negative (-0.5C > delta > -2C by default), available intemplate as .TemperatureTrend",
"default":"↘"
},
"singledown_icon": {
"type":"string",
"title":"Temperature trend icon, high negative change",
"description":"Delta between this and prior temperature reading is large negative (-2C > delta > -4C by default), available intemplate as .TemperatureTrend",
"default":"↓"
},
"doubledown_icon": {
"type":"string",
"title":"Temperature trend icon, very high negative change",
"description":"Delta between this and prior temperature reading is very large negative (> -4C by default), available intemplate as .TemperatureTrend",
"default":"↓↓"
},
"planning_status_icon": {
"type":"string",
"title":"Icon for batch in planning",
"description":"Available in template as .StatusIcon",
"default":"\uF8EA"
},
"brewing_status_icon": {
"type":"string",
"title":"Icon for batch being brewed",
"description":"Available in template as .StatusIcon",
"default":"\uF7DE"
},
"fermenting_status_icon": {
"type":"string",
"title":"Icon for batch fermenting",
"description":"Available in template as .StatusIcon",
"default":"\uF499"
},
"conditioning_status_icon": {
"type":"string",
"title":"Icon for batch conditioning",
"description":"Available in template as .StatusIcon",
"default":"\uE372"
},
"completed_status_icon": {
"type":"string",
"title":"Icon for completed batch",
"description":"Available in template as .StatusIcon",
"default":"\uF7A5"
},
"archived_status_icon": {
"type":"string",
"title":"Icon for archived batch",
"description":"Available in template as .StatusIcon",
"default":"\uF187"
}
}
}