Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
1weather
Commits
c25ff0f3
Commit
c25ff0f3
authored
Apr 12, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct AQI scales.
parent
6957e2c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
55 deletions
+37
-55
1Weather/Model/ModelObjects/Health/Health.swift
+37
-55
No files found.
1Weather/Model/ModelObjects/Health/Health.swift
View file @
c25ff0f3
...
...
@@ -230,73 +230,55 @@ public struct Pollutant: Equatable, Hashable {
public
private
(
set
)
var
status
:
HealthStatus
private
let
hazardousLevelStart
:
Double
?
/// Preferably these should be configurable from the server.
/// See https://en.wikipedia.org/wiki/Air_quality_index
/// The "AQI Category, Pollutants and Health Breakpoints" table.
/// Climacell API reference: https://docs.tomorrow.io/reference/data-layers-air
private
static
let
upperLimits
:
[
String
:
[
HealthStatus
:
Double
]]
=
[
"pm10"
:
[
.
good
:
50
.0
,
.
moderate
:
10
0
.0
,
.
unhealthyForSensitiveGroups
:
2
50
.0
,
.
unhealthy
:
3
50
.0
,
.
veryUnhealthy
:
43
0.0
,
.
hazardous
:
Double
.
infinity
.
good
:
27
.0
,
.
moderate
:
10
4
.0
,
.
unhealthyForSensitiveGroups
:
2
04
.0
,
.
unhealthy
:
3
04
.0
,
.
veryUnhealthy
:
39
0.0
,
.
hazardous
:
Double
.
infinity
// 515.0
],
"pm2.5"
:
[
.
good
:
30
.0
,
.
moderate
:
60
.0
,
.
unhealthyForSensitiveGroups
:
90
.0
,
.
unhealthy
:
1
20
.0
,
.
veryUnhealthy
:
2
5
0.0
,
.
hazardous
:
Double
.
infinity
.
good
:
6
.0
,
.
moderate
:
24
.0
,
.
unhealthyForSensitiveGroups
:
45
.0
,
.
unhealthy
:
1
03
.0
,
.
veryUnhealthy
:
2
0
0.0
,
.
hazardous
:
Double
.
infinity
// 375.0
],
"no2"
:
[
.
good
:
40
.0
,
.
moderate
:
80
.0
,
.
unhealthyForSensitiveGroups
:
18
0.0
,
.
unhealthy
:
280
.0
,
.
veryUnhealthy
:
40
0.0
,
.
hazardous
:
Double
.
infinity
.
good
:
22
.0
,
.
moderate
:
77
.0
,
.
unhealthyForSensitiveGroups
:
23
0.0
,
.
unhealthy
:
505
.0
,
.
veryUnhealthy
:
95
0.0
,
.
hazardous
:
Double
.
infinity
// 1650.0
],
"o3"
:
[
.
good
:
50
.0
,
.
moderate
:
100
.0
,
.
unhealthyForSensitiveGroups
:
1
68
.0
,
.
unhealthy
:
208
.0
,
.
veryUnhealthy
:
748
.0
,
.
hazardous
:
Double
.
infinity
.
good
:
27
.0
,
.
moderate
:
62
.0
,
.
unhealthyForSensitiveGroups
:
1
45
.0
,
.
unhealthy
:
185
.0
,
.
veryUnhealthy
:
305
.0
,
.
hazardous
:
Double
.
infinity
// 505.0
],
"co"
:
[
.
good
:
1.0
,
.
moderate
:
2
.0
,
.
unhealthyForSensitiveGroups
:
1
0
.0
,
.
unhealthy
:
1
7
.0
,
.
veryUnhealthy
:
34
.0
,
.
hazardous
:
Double
.
infinity
.
good
:
2.2
,
.
moderate
:
7
.0
,
.
unhealthyForSensitiveGroups
:
1
1
.0
,
.
unhealthy
:
1
4
.0
,
.
veryUnhealthy
:
23
.0
,
.
hazardous
:
Double
.
infinity
// 41.0
],
"so2"
:
[
.
good
:
40.0
,
.
moderate
:
80.0
,
.
unhealthyForSensitiveGroups
:
380.0
,
.
unhealthy
:
800.0
,
.
veryUnhealthy
:
1600.0
,
.
hazardous
:
Double
.
infinity
],
"nh3"
:
[
.
good
:
200.0
,
.
moderate
:
400.0
,
.
unhealthyForSensitiveGroups
:
800.0
,
.
unhealthy
:
1200.0
,
.
veryUnhealthy
:
1800.0
,
.
hazardous
:
Double
.
infinity
],
"pb"
:
[
.
good
:
0.5
,
.
moderate
:
1.0
,
.
unhealthyForSensitiveGroups
:
2.0
,
.
unhealthy
:
3.0
,
.
veryUnhealthy
:
3.5
,
.
hazardous
:
Double
.
infinity
.
good
:
18.0
,
.
moderate
:
56.0
,
.
unhealthyForSensitiveGroups
:
131.0
,
.
unhealthy
:
245.0
,
.
veryUnhealthy
:
455.0
,
.
hazardous
:
Double
.
infinity
// 805.0
]
]
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment