Weather service proxy support
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build and Publish / release (push) Successful in 3m51s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build and Publish / release (push) Successful in 3m51s
				
			This commit is contained in:
		
							
								
								
									
										36
									
								
								pkg/ambient/config/config.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								pkg/ambient/config/config.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| 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"` | ||||
| 	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) | ||||
|  | ||||
| 	// Required if proxying to awn/wu is enabled | ||||
| 	WundergroundID       string `yaml:"wundergroundID"` | ||||
| 	WundergroundPassword string `yaml:"wundergroundPassword"` | ||||
| 	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 | ||||
| 	// 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"` | ||||
| 	DropMetrics []string `yaml:"dropMetrics"` | ||||
| } | ||||
		Reference in New Issue
	
	Block a user