2025-01-08 21:49:31 +00:00
|
|
|
package ambient
|
|
|
|
|
|
|
|
import (
|
|
|
|
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/config"
|
|
|
|
|
|
|
|
"gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/weather"
|
|
|
|
)
|
|
|
|
|
|
|
|
// This configuration includes all config from go-app/config.AppConfig
|
|
|
|
type AmbientLocalExporterConfig struct {
|
|
|
|
MetricPrefix string `yaml:"metricPrefix" default:"weather" env:"AMBIENT_METRIC_PREFIX"`
|
|
|
|
WeatherStations []WeatherStation `yaml:"weatherStations"` // No env, too complex, not worth the time
|
|
|
|
*config.AppConfig // Extends app config
|
|
|
|
}
|
|
|
|
|
|
|
|
type WeatherStation struct {
|
|
|
|
Name string `yaml:"name"` // Human Friendly Name (e.g. Back Yard Weather)
|
|
|
|
Equipment string `yaml:"equipment"` // Equipment Type (e.g. WS-5000)
|
|
|
|
|
|
|
|
// One of these is required, based on the type
|
|
|
|
// set in the "Custom" weather service on your
|
|
|
|
// console, weather station, or weather hub
|
|
|
|
WundergroundID string `yaml:"wundergroundID"`
|
|
|
|
AWNPassKey string `yaml:"awnPassKey"`
|
|
|
|
|
|
|
|
// Proxy updates to AWN or Wunderground
|
|
|
|
ProxyToAWN bool `yaml:"proxyToAWN"`
|
|
|
|
ProxyToWunderground bool `yaml:"proxyToWunderground"`
|
|
|
|
|
|
|
|
// Unreliable / unwanted metrics by name of WeatherUpdate Field
|
2025-01-09 02:28:38 +00:00
|
|
|
// will be excluded if present in discardMetrics
|
|
|
|
//
|
|
|
|
// If anything is present in keepMetrics, it is solely applied,
|
|
|
|
// ignoring discardMetrics
|
|
|
|
KeepMetrics []weather.WeatherUpdateField `yaml:"keepMetrics"`
|
|
|
|
DropMetrics []weather.WeatherUpdateField `yaml:"dropMetrics"`
|
2025-01-08 21:49:31 +00:00
|
|
|
}
|