diff --git a/changelog.md b/changelog.md index 5a626ee5..e2cee71d 100644 --- a/changelog.md +++ b/changelog.md @@ -754,4 +754,5 @@ See https://github.com/Daveiano/weewx-wdc/compare/v3.3.0...580071ca175a03fe4924b - Open Webcam Links/Stat Tile links in a Modal GH-220 - Bugfix: Max Rain Rate Does Not Reset GH-224 - Added MQTT connection with username/password GH-225 -- Added finnish translation GH-230 \ No newline at end of file +- Added finnish translation GH-230 +- Added "Precipitation detail" on forecast display (show rain/snow separately) GH-231 diff --git a/install.py b/install.py index fef70b67..016fbac5 100644 --- a/install.py +++ b/install.py @@ -158,6 +158,8 @@ def __init__(self): "skins/weewx-wdc/includes/icons/forecast/rain--scattered.svg", "skins/weewx-wdc/includes/icons/forecast/thunderstorm.svg", "skins/weewx-wdc/includes/icons/forecast/thunderstorm--scattered.svg", + "skins/weewx-wdc/includes/icons/forecast/rain-drop.svg", + "skins/weewx-wdc/includes/icons/forecast/snowflake.svg", ], ), ], diff --git a/skins/weewx-wdc/includes/forecast-table.inc b/skins/weewx-wdc/includes/forecast-table.inc index 27c2095f..80f12bd4 100644 --- a/skins/weewx-wdc/includes/forecast-table.inc +++ b/skins/weewx-wdc/includes/forecast-table.inc @@ -32,6 +32,7 @@ #set $show_moon = 0 #set $show_pop = 1 #set $show_precip = 1 +#set $show_precip_detail = 1 #set $show_obvis = 0 #set $local_settings = dict() @@ -67,6 +68,7 @@ #set $show_moon = int($local_settings.get('show_moon', $show_moon)) #set $show_pop = int($local_settings.get('show_pop', $show_pop)) #set $show_precip = int($local_settings.get('show_precip', $show_precip)) +#set $show_precip_detail = int($local_settings.get('show_precip_detail', $show_precip_detail)) #set $show_obvis = int($local_settings.get('show_obvis', $show_obvis)) #set $num_days = $local_settings.get('num_days', $num_days) @@ -456,63 +458,75 @@ #set $lastday = $thisday #set $summary = $forecast.weather_summary($forecast_source, $period.event_ts.raw, periods=$periods) - - #if $summary.pop.raw is not None and $summary.pop.raw > 0 $summary.pop.format('%.0f','') #end if - #end if #end for #end if - #if $show_precip + #set $vertical_align = "top" if $show_precip_detail else "bottom" #if $show_legend - - $obs.label.rain
+ + $gettext('Precipitation')
in $unit.label.rain
#end if - #for $x, $period in enumerate($periods) #set $thisday = $period.event_ts.format('%d') #if $lastday != $thisday #set $lastday = $thisday #set $summary = $forecast.weather_summary($forecast_source, $period.event_ts.raw, periods=$periods) - - + + #set $rain = $summary.qpf.raw is not None and $summary.qpf.raw > 0 #set $snow = $summary.qsf.raw is not None and $summary.qsf.raw > 0 #if $rain or $snow - #if $rain and not $snow - - $summary.qpf.nolabel('%.2f','') - #end if +
+ #if $rain and not $snow + $summary.qpf.nolabel('%.2f','') + #end if - #if $snow and not $rain - - $summary.qsf.nolabel('%.2f','') - #end if + #if $snow and not $rain + $summary.qsf.nolabel('%.2f','') + #end if - #if $rain and $snow - - #set $q_pf_sf = '{:.2f}'.format($summary.qpf.raw + $summary.qsf.raw) - $q_pf_sf + #if $rain and $snow + + #set $q_pf_sf = '{:.2f}'.format($summary.qpf.raw + $summary.qsf.raw) + $q_pf_sf + #end if +
+ + #if $show_precip_detail + #if $rain +
+ #include 'includes/icons/forecast/rain-drop.svg' + $summary.qpf.nolabel('%.2f','') +
+ #end if + + #if $snow +
+ #include 'includes/icons/forecast/snowflake.svg' + $summary.qsf.nolabel('%.2f','') +
+ #end if #end if + #end if #if not $rain and not $snow - #end if
- #end if #end for
@@ -522,7 +536,6 @@ - #if $show_hourly #set $periods = $all_periods