possible bug in index.html.tmpl for skip_if_empty option

59 views
Skip to first unread message

William Garber

unread,
Feb 26, 2023, 1:59:24 AM2/26/23
to weewx-user
I set skip_if_empty to False.  I listed the plots in plot_groups in weewx.conf if and only if I wanted to see them (even if empty).  This did not work.  It generated the plots for wind (even though there was no data).  That is what I wanted.  However the index.html.tmpl did not recognize the skip_if_empty = False i.e. it still skipped the plot because it had not changed.

I made this change to index.html.tmpl in the skin (I customized it) and it worked:

  #for plot_group in $plot_groups
    #set $show_plot = 0
    #*
      The plot name is just the concatenation of the period and the plot group.
      For example, 'year' + 'tempdew' yields 'yeartempdew'.
    *#
    #set $plot_name = $period + $plot_group
    #for obs in $getobs($plot_name)
    #* garberw commented out to always show plot e.g. not skip_if_empty
    #if $recent.check_for_data($obs)
    *#
        #set $show_plot = 1
    #* garberw commented out to always show plot e.g. not skip_if_empty
      #end if
    *#
    #end for
    #if $show_plot
            <img src="${plot_name}.png" alt="${plot_name}"/>
    #end if
  #end for

but this is not ideal.

Tom Keffer

unread,
Feb 26, 2023, 8:45:11 AM2/26/23
to weewx...@googlegroups.com
I was able to reproduce this.

I've created issue #847 to track. Thanks for the bug report!

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/826729ab-f660-4e0c-a0a2-0a9a9bf43147n%40googlegroups.com.

William Garber

unread,
Feb 26, 2023, 7:04:31 PM2/26/23
to weewx-user
I think it needs to check if the .png file already exists.
Reply all
Reply to author
Forward
0 new messages