fermentord/internal/controllers/config.go

44 lines
1.4 KiB
Go
Raw Normal View History

2021-08-30 20:46:38 +00:00
package controllers
2021-11-16 05:19:24 +00:00
type ControllerConfig struct {
2022-03-05 19:42:17 +00:00
NATS struct {
URL string `mapstructure:"url"`
Stream string `mapstructure:"stream"`
Subject struct {
Temp string `mapstructure:"temp"`
State string `mapstructure:"state"`
} `mapstructure:"subject"`
} `mapstructure:"nats"`
HTTP struct {
Port int16 `mapstructure:"port"`
} `mapstructure:"http"`
DataPath string `mapstructure:"data_path"`
2021-11-16 05:19:24 +00:00
Sensor struct {
Wort string `mapstructure:"wort"`
Chamber string `mapstructure:"chamber"`
Ambient string `mapstructure:"ambient"`
} `mapstructure:"sensors"`
2021-08-30 20:46:38 +00:00
FermentationTemperature float64 `mapstructure:"fermentation_temp"`
2022-03-05 19:42:17 +00:00
DeltaTemperatureCool float64 `mapstructure:"delta_temp_cool"`
DeltaTemperatureHeat float64 `mapstructure:"delta_temp_heat"`
2021-11-16 05:19:24 +00:00
Limits struct {
MinChamberTemperature float64 `mapstructure:"min_chamber_temp"`
2022-03-05 19:42:17 +00:00
MaxChamberTemperature float64 `mapstructure:"max_chamber_temp"`
MinCoolerRuntimeSecs float64 `mapstructure:"min_cooler_runtime_secs"`
MaxCoolerRuntimeSecs float64 `mapstructure:"max_cooler_runtime_secs"`
MinCoolerCooldownSecs float64 `mapstructure:"min_cooler_cooldown_secs"`
HeaterGraceTimeSecs float64 `mapstructure:"heater_grace_time_secs"`
2021-11-16 05:19:24 +00:00
} `mapstructure:"limits"`
PID struct {
2021-08-30 20:46:38 +00:00
Kp float64 `mapstructure:"kp"` // 2.0
Ki float64 `mapstructure:"ki"` // 0.0001
Kd float64 `mapstructure:"kd"` // 2.0
} `mapstructure:"pid"`
}