Skip to content

Commit

Permalink
SYS-506 fix conditionals for aqi chart display
Browse files Browse the repository at this point in the history
  • Loading branch information
instantlinux committed Oct 5, 2020
1 parent a37c23c commit b8c60b2
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 14 deletions.
2 changes: 1 addition & 1 deletion current.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<img src="daywinddir.png" alt="Hi Wind" />
<img src="dayinside.png" alt="Inside" />
<img src="daywindvec.png" alt="Wind Vector" />
#if $period2.pm2_5.has_data
#if $Extras.has_key('optionalAccessories') and $period2.pm2_5.has_data
<img src="dayaqi.png" alt="Air Quality" />
#end if
#if $Extras.has_key('optionalAccessories') and $period2.radiation.has_data
Expand Down
2 changes: 1 addition & 1 deletion include/chart.inc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
</td>
</tr>
#end if
#if $period2.pm2_5.has_data
#if $Extras.has_key('optionalAccessories') and $period2.pm2_5.has_data
<tr>
<td class="stats_label">
AQI Range
Expand Down
27 changes: 22 additions & 5 deletions include/current.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,33 @@
<td class="stats_data">$current.extraTemp1</td>
</tr>
#end if
#if $day.pm2_5.has_data
#if $Extras.has_key('optionalAccessories') and $day.pm2_5.has_data
#set pmdata = '%.2f, %.2f, %.2f %s' % ($current.pm1_0.raw, $current.pm2_5.raw, $current.pm10_0.raw, $unit.label.pm2_5)
#if $current.pm2_5_aqi.raw > 300
#set pmcolor = '581845'
#else if $current.pm2_5_aqi.raw > 200
#set pmcolor = 'F80000'
#else if $current.pm2_5_aqi.raw > 150
#set pmcolor = '900C3F'
#else if $current.pm2_5_aqi.raw > 100
#set pmcolor = 'F39C12'
#else if $current.pm2_5_aqi.raw > 50
#set pmcolor = 'F8F800'
#end if
<tr>
<td class="stats_label">PM2.5 Concentration</td>
<td class="stats_data">$current.pm2_5</td>
<td class="stats_label">PM1, 2.5, 10 Concentration</td>
<td class="stats_data">$pmdata</td>
</tr>
<tr>
<td class="stats_label">AQI</td>
<td class="stats_data">$current.pm2_5_aqi</td>
#if $current.pm2_5_aqi.raw >= 50
<td class="stats_data" bgcolor="#$pmcolor">
#else
<td>
#end if
$current.pm2_5_aqi</td>
</tr>
#end if
#end if
#if $Extras.has_key('optionalAccessories') and $day.UV.has_data
<tr>
<td class="stats_label">UV</td>
Expand Down
2 changes: 1 addition & 1 deletion month.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<img src="monthwinddir.png" alt="Hi Wind" />
<img src="monthinside.png" alt="Inside" />
<img src="monthwindvec.png" alt="Wind Vector" />
#if $period2.pm2_5_aqi.has_data
#if $Extras.has_key('optionalAccessories') and $period2.pm2_5.has_data
<img src="monthaqi.png" alt="Air Quality" />
#end if
#if $Extras.has_key('optionalAccessories') and $period2.UV.has_data
Expand Down
2 changes: 1 addition & 1 deletion skin.conf
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@
[[[[windvec]]]]
plot_type = vector

[[[monthaqi]]]
[[[yearaqi]]]
yscale = 0, None, 20
[[[[pm2_5_aqi]]]]

Expand Down
2 changes: 1 addition & 1 deletion week.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<img src="weekwinddir.png" alt="Hi Wind" />
<img src="weekinside.png" alt="Inside" />
<img src="weekwindvec.png" alt="Wind Vector" />
#if $period2.pm2_5_aqi.has_data
#if $Extras.has_key('optionalAccessories') and $period2.pm2_5.has_data
<img src="weekaqi.png" alt="Air Quality" />
#end if
#if $Extras.has_key('optionalAccessories') and $period2.UV.has_data
Expand Down
8 changes: 4 additions & 4 deletions year.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@
</td>
</tr>
#end if
#if $year.pm2_5.has_data
#if $Extras.has_key('optionalAccessories') and $year.pm2_5.has_data
<tr>
<td class="stats_label">
High AQI<br/>
Low AQI
</td>
<td class="stats_data">
$year.pm2_5_aqi.max at $year.pm2_5_aqi.maxtime<br/>
$year.pm2_5_aqi.min at $year.pm2_5_aqi.mintime
$year.pm2_5_aqi.max at $year.pm2_5.maxtime<br/>
$year.pm2_5_aqi.min at $year.pm2_5.mintime
</td>
</tr>
#end if
Expand Down Expand Up @@ -242,7 +242,7 @@
<img src="yearwinddir.png" alt="Hi Wind" />
<img src="yearinside.png" alt="Inside" />
<img src="yearwindvec.png" alt="Wind Vector" />
#if $year.pm2_5_aqi.has_data
#if $Extras.has_key('optionalAccessories') and $year.pm2_5.has_data
<img src="yearaqi.png" alt="Air Quality" />
#end if
#if $Extras.has_key('optionalAccessories') and $year.UV.has_data
Expand Down

0 comments on commit b8c60b2

Please sign in to comment.