def density_to_air_quality(density):
    """Map PM2.5 density to HomeKit AirQuality level."""
    if density <= 35:
        return 1
    elif density <= 75:
        return 2
    elif density <= 115:
        return 3
    elif density <= 150:
        return 4
    return 5