Compare commits
	
		
			2 Commits
		
	
	
		
			v0.2.5
			...
			2e3cfb44f4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2e3cfb44f4 | |||
| be8a4f3bca | 
@@ -85,6 +85,7 @@ func (aw *AmbientWeather) handleProviderRequest(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		w.WriteHeader(http.StatusInternalServerError)
 | 
							w.WriteHeader(http.StatusInternalServerError)
 | 
				
			||||||
		w.Write([]byte(err.Error()))
 | 
							w.Write([]byte(err.Error()))
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Calculate any fields that may be missing
 | 
						// Calculate any fields that may be missing
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,10 @@ import "math"
 | 
				
			|||||||
// Attempts to complete missing fields that may not
 | 
					// Attempts to complete missing fields that may not
 | 
				
			||||||
// be set by a specific provider, such as DewPoint and WindChill
 | 
					// be set by a specific provider, such as DewPoint and WindChill
 | 
				
			||||||
func (u *WeatherUpdate) Enrich() {
 | 
					func (u *WeatherUpdate) Enrich() {
 | 
				
			||||||
 | 
						if u == nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if u.WindChillF == 0 {
 | 
						if u.WindChillF == 0 {
 | 
				
			||||||
		u.WindChillF = CalculateWindChill(u.TempOutdoorF, u.WindSpeedMPH)
 | 
							u.WindChillF = CalculateWindChill(u.TempOutdoorF, u.WindSpeedMPH)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user