Skip to content

Commit

Permalink
v3.5.0b8: suport rain and snow icons in WU forecasts.
Browse files Browse the repository at this point in the history
  • Loading branch information
chaunceygardiner committed Aug 24, 2020
1 parent 6f6b69e commit 0d7f1ab
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
16 changes: 15 additions & 1 deletion bin/user/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@
from weewx.engine import StdService
from weewx.cheetahgenerator import SearchList

VERSION = "3.4.0b7"
VERSION = "3.4.0b8"

if weewx.__version__ < "4":
raise weewx.UnsupportedFeature(
Expand Down Expand Up @@ -2557,6 +2557,20 @@ def create_records_from_five_day(fc, issued_ts, now, location=None):
r['clouds'] = 'B1'
else:
r['clouds'] = 'OV'
# Precip
precip_type = fc['daypart'][0]['precipType'][daypart_index]
precip_chance = fc['daypart'][0]['precipChance'][daypart_index]
if precip_chance > 0 and (precip_type == 'rain' or precip_type == 'snow'):
if precip_chance < 30:
r[precip_type] = 'S'
elif precip_chance < 60:
r[precip_type] = 'C'
elif precip_chance < 80:
r[precip_type] = 'L'
elif precip_chance < 100:
r[precip_type] = 'O'
else:
r[precip_type] = 'D'
if half_day_index == 0:
r['tempMax'] = Forecast.str2float(
'temperatureMax', fc['temperatureMax'][half_day_index], WU_KEY)
Expand Down
2 changes: 1 addition & 1 deletion install.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def loader():
class ForecastInstaller(ExtensionInstaller):
def __init__(self):
super(ForecastInstaller, self).__init__(
version="3.4.0b7",
version="3.4.0b8",
name='forecast',
description='Generate and display weather and tide forecasts.',
author="Matthew Wall",
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Installation instructions:

1) run the installer:

wee_extension --install weewx-forecast-3.4.0b7.zip
wee_extension --install weewx-forecast-3.4.0b8.zip

2) modify weewx.conf for your location:

Expand Down

0 comments on commit 0d7f1ab

Please sign in to comment.