So a better strategy for me would be to try to include the hours of sunshine in the station observations?
Pat schrieb am Mittwoch, 24. Juni 2020 um 20:37:13 UTC+2: > Ok that makes more sense. Right now the reloads are only for images, not > text. > > I'm not sure how I'd be able to reliably reload the hook area text. Those > .inc files are only called when the skin is generated, and when the page is > reloaded. The AJAX portion does not reload them (since they're unavailable > to the public because they live in the skins folder). > > > On Wednesday, June 24, 2020 at 2:30:12 PM UTC-4, Manfred Maier wrote: >> >> It's text. >> I'm displaying the amount of sunshine hours on that day. In a somewhat >> dynamic way. >> >> Here's the index_hook_after_station_info I'm using. >> >> #set sunshinetime = $day.sunshineTime.sum.raw >> #set sunshinetheoretical = $day.sunshineTheoretical.sum.raw >> #set ratio = 0 >> >> #set hours = int($sunshinetime / 60) >> #set minutes = int($sunshinetime - ($hours * 60)) >> >> #if $sunshinetheoretical > 0 >> #set $ratio = $sunshinetime / $sunshinetheoretical >> #end if >> >> #set $hoursstr = str($hours) >> >> #if $minutes < 10 >> #set $minutesstr = '0' + str($minutes) >> #else >> #set $minutesstr = str($minutes) >> #end if >> >> #set $sundurationtext = $hoursstr + ':' + $minutesstr + ' Stunden' >> >> #if $sunshinetheoretical > 0 and $current.sunshineTheoretical.raw == >> 0 and $sunshinetime > 0 >> #set $suntext = 'Heute gab es insgesamt ' + $sundurationtext + ' >> Sonnenschein.' >> #else if $sunshinetheoretical > 0 and >> $current.sunshineTheoretical.raw == 0 and $sunshinetime == 0 >> #set $suntext = 'Heute gab es leider gar keinen Sonnenschein.' >> #else if $ratio >= 0.7 >> #set $suntext = 'Heute gab es schon ' + $sundurationtext + ' >> Sonnenschein.' >> #else if $ratio >= 0.4 >> #set $suntext = 'Heute gab es bisher ' + $sundurationtext + ' >> Sonnenschein.' >> #else if $ratio < 0.4 and $sunshinetheoretical > 0 and $sunshinetime >> > 0 >> #set $suntext = 'Heute gab es erst ' + $sundurationtext + ' >> Sonnenschein.' >> #else if $ratio < 0.4 and $sunshinetheoretical > 0 and $sunshinetime >> == 0 >> #set $suntext = 'Heute gab es leider noch keinen Sonnenschein.' >> #else >> #set $suntext = '' >> #end if >> >> #set $dailyrain = $day.rain.sum.raw >> >> #if $dailyrain == 0 >> #set raintext = 'Bisher kein Regen.' >> #else >> #set $raintext = 'Bisher ' + str($day.rain.sum) + ' Regen.' >> #end if >> >> <br> >> <p align="center" style="font-size:24px"> >> $suntext $raintext >> </p> >> <br> >> >> -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/a0a4f98d-d748-4bb7-8530-b9aab705a34an%40googlegroups.com.