--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hello !
Regarding the $hourly option, i discovered the § regarding custom generator in the customize guide.
I was thinking why not create hourly option for all data.
So I used mygenerator.py from example, and copy the file to mygenerator2.py.
In this one, I copy paste the part regarding seven days data and replace "sevenday" by "hours"
I have this:
formatter=self.formatter,
converter=self.converter) #6
+ # Now get a TimeSpanStats object for the hourly stats. This one we
+ # will have to calculate. First, calculate the time at midnight, seven
+ # days ago. The variable week_dt will be an instance of datetime.date.
+ hour_dt = datetime.date.fromtimestamp(valid_timespan.stop) - datetime.timedelta(hours=1) #4bis
+ # Now convert it to unix epoch time:
+ hour_ts = time.mktime(week_dt.timetuple()) # 5bis
+ # Now form a TimeSpanStats object, using the time span we just calculated:
+ hourly_stats = TimeSpanStats(TimeSpan(hour_ts, valid_timespan.stop),
+ statsdb,
+ formatter=self.formatter,
+ converter=self.converter) #6bis
# Get the superclass's search list:
search_list = FileGenerator.getToDateSearchList(self, archivedb, statsdb, valid_timespan) # 7
# Now tack on my two additions as a small dictionary with keys 'alltime' and 'seven_day':
search_list += [ {'alltime' : all_stats,
'seven_day' : seven_day_stats,
+ 'hourly' : hourly_stats} ] # 8
return search_list--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Heyhey now I understand my confusion :-)
$day data was looking like hourly data because it's at 0:40 that I have done the test. So day data is on last hour only.
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/nbe5WFbObiU/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.