On Tue, Mar 7, 2017 at 11:40 PM, Tony Colley <[email protected]> wrote:

> Is there something missing from xstats.py needed to support
> heatdeg/cooldeg?
>
>
​Yes, there is. The xstats.py example uses a simplified way of building the
TimespanBinder object. Here's a patch that uses a more compete method. Let
me know if it works.

diff --git a/extensions/xstats/bin/user/xstats.py
b/extensions/xstats/bin/user/xstats.py
index f663f09..725e35d 100644
--- a/extensions/xstats/bin/user/xstats.py
+++ b/extensions/xstats/bin/user/xstats.py
@@ -46,7 +46,11 @@
                                    db_lookup,
                                    context='alltime',
                                    formatter=self.generator.formatter,
-                                   converter=self.generator.converter)
+                                   converter=self.generator.converter,
+
week_start=self.generator.stn_info.week_start,
+
rain_year_start=self.generator.stn_info.rain_year_start,
+                                   trend=trend_dict,
+                                   skin_dict=self.generator.skin_dict)

         # Now create a TimespanBinder for the last seven days. This one we
         # will have to calculate. First, calculate the time at midnight,
seven
@@ -59,7 +63,11 @@
                                          db_lookup,
                                          context='seven_day',

formatter=self.generator.formatter,
-
converter=self.generator.converter)
+
converter=self.generator.converter,
+
week_start=self.generator.stn_info.week_start,
+
rain_year_start=self.generator.stn_info.rain_year_start,
+                                         trend=trend_dict,
+
skin_dict=self.generator.skin_dict)

         # Now use a similar process to get statistics for the last 30 days.
         days_dt = datetime.date.fromtimestamp(timespan.stop) -
datetime.timedelta(days=30)

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to