UVI & AQ Label fixes

This commit is contained in:
2026-06-24 10:23:51 -04:00
parent fa79835572
commit 811780125e
2 changed files with 7 additions and 7 deletions

View File

@@ -136,12 +136,12 @@ def gas_to_aqi(gas_ohms, humidity, gas_reference):
hum_score = 25 - abs(humidity - 40) * 0.5
quality = min(max(gas_score + hum_score, 0), 100)
aqi = round((1 - quality / 100) * 500)
if aqi <= 50: label = 'Good'
elif aqi <= 100: label = 'Standard'
elif aqi <= 150: label = 'Warning'
elif aqi <= 200: label = 'Unhealthy'
elif aqi <= 300: label = 'Very Unhealthy'
else: label = 'Hazardous'
if aqi <= 50: label = 'Minimal'
elif aqi <= 100: label = 'Low'
elif aqi <= 150: label = 'Moderate'
elif aqi <= 200: label = 'Medium'
elif aqi <= 300: label = 'High'
else: label = 'Hazard'
return aqi, label
def sea_level_pressure(pressure_hpa, alt_m):