49 lines
2.2 KiB
Go
49 lines
2.2 KiB
Go
package config
|
|
|
|
import (
|
|
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/config"
|
|
)
|
|
|
|
// This configuration includes all config from go-app/config.AppConfig
|
|
type AmbientLocalExporterConfig struct {
|
|
MetricPrefix string `yaml:"metricPrefix" default:"weather" env:"AMBIENT_METRIC_PREFIX" json:"metricPrefix,omitempty"`
|
|
UpdatesToKeep *int `yaml:"updatesToKeep" default:"1" env:"AMBIENT_UPDATES_TO_KEEP" json:"updatesToKeep,omitempty"`
|
|
WeatherStations []WeatherStation `yaml:"weatherStations" json:"weatherStations,omitempty"` // No env, too complex, not worth the time
|
|
RecorderConfig *RecorderConfig `yaml:"recorderConfig" json:"recorderConfig,omitempty"`
|
|
*config.AppConfig // Extends app config
|
|
}
|
|
|
|
type WeatherStation struct {
|
|
Name string `yaml:"name" json:"name,omitempty"` // Human Friendly Name (e.g. Back Yard Weather)
|
|
Equipment string `yaml:"equipment" json:"equipment,omitempty"` // Equipment Type (e.g. WS-5000)
|
|
|
|
// Required if proxying to awn/wu is enabled
|
|
WundergroundID string `yaml:"wundergroundID" json:"wundergroundID,omitempty"`
|
|
WundergroundPassword string `yaml:"wundergroundPassword" json:"wundergroundPassword,omitempty"`
|
|
AWNPassKey string `yaml:"awnPassKey" json:"awnPassKey,omitempty"`
|
|
|
|
// Proxy updates to AWN or Wunderground
|
|
ProxyToAWN bool `yaml:"proxyToAWN" json:"proxyToAWN,omitempty"`
|
|
ProxyToWunderground bool `yaml:"proxyToWunderground" json:"proxyToWunderground,omitempty"`
|
|
|
|
// Unreliable / unwanted metrics by name of WeatherUpdate Field
|
|
// will be excluded if present in discardMetrics
|
|
//
|
|
// If anything is present in keepMetrics, it is solely applied,
|
|
// ignoring discardMetrics.
|
|
//
|
|
// Check weather.WeatherUpdateField for options
|
|
KeepMetrics []string `yaml:"keepMetrics" json:"keepMetrics,omitempty"`
|
|
DropMetrics []string `yaml:"dropMetrics" json:"dropMetrics,omitempty"`
|
|
|
|
// Relabels battery and sensor names
|
|
// Temp+Humidity Sensors:
|
|
// - TempHumiditySensor[1-8]
|
|
// Batteries:
|
|
// - IndoorSensor
|
|
// - OutdoorSensor
|
|
// - RainSensor
|
|
// - CO2Sensor
|
|
SensorMappings map[string]string `yaml:"sensorMappings" json:"sensorMappings,omitempty"`
|
|
}
|