diff --git a/bin/user/weewx_wdc.py b/bin/user/weewx_wdc.py
index 86235e46..ceb16be8 100644
--- a/bin/user/weewx_wdc.py
+++ b/bin/user/weewx_wdc.py
@@ -26,7 +26,7 @@
from weewx.wxformulas import beaufort
from weeutil.weeutil import TimeSpan, rounder, to_bool, to_int, startOfDay, startOfArchiveDay
from weeutil.config import search_up, accumulateLeaves
-
+from weewx.tags import TimespanBinder
try:
import weeutil.logger
@@ -354,7 +354,20 @@ def __init__(self, generator):
"wx_binding"
)
- # print(self.generator.config_dict["StdWXCalculate"]["Calculations"])
+ def format_raw_value(self, value, obs):
+ """
+ Returns a ValueHelper for a raw value and an obs type.
+
+ Args:
+ value (float): The value
+ obs (string): The observation
+ """
+ target_unit_t = self.generator.converter.getTargetUnit(
+ obs_type=obs)
+ value_vt = (value, target_unit_t[0], target_unit_t[1])
+
+ return ValueHelper(value_t=value_vt, formatter=self.generator.formatter)
+
def get_software_obs(self):
"""
@@ -1148,6 +1161,48 @@ def get_dwd_warnings(self):
class WdcArchiveUtil(SearchList):
+ def __init__(self, generator):
+ SearchList.__init__(self, generator)
+
+ def get_extension_list(self, timespan, db_lookup):
+ """Returns a search list extension with two additions.
+
+ Parameters:
+ timespan: An instance of weeutil.weeutil.TimeSpan. This will
+ hold the start and stop times of the domain of
+ valid times.
+
+ db_lookup: This is a function that, given a data binding
+ as its only parameter, will return a database manager
+ object.
+ """
+
+ self.db_lookup = db_lookup
+
+ search_list_extension = {
+ "get_stat_table_month_obs": self.get_stat_table_month_obs,
+ "get_day_archive_enabled": self.get_day_archive_enabled,
+ "get_archive_days_array": self.get_archive_days_array,
+ "filter_months": self.filter_months,
+ "fake_get_report_years": self.fake_get_report_years,
+ }
+
+ return [search_list_extension]
+
+ def get_stat_table_month_obs(self, start_ts, end_ts):
+ """
+ Returns a TimeSpanBinder a period.
+
+ Args:
+ start_ts (int): The start timestamp
+ end_ts (int): The end timestamp
+ """
+ month_timespan = TimeSpan(start_ts, end_ts)
+ month_timespan_binder = TimespanBinder(month_timespan, self.db_lookup,
+ formatter=self.generator.formatter,
+ converter=self.generator.converter)
+ return month_timespan_binder
+
def get_day_archive_enabled(self):
"""
Get day archive enabled.
diff --git a/changelog.md b/changelog.md
index 6d43603d..e0e17b01 100644
--- a/changelog.md
+++ b/changelog.md
@@ -765,3 +765,4 @@ See https://github.com/Daveiano/weewx-wdc/compare/v3.3.0...580071ca175a03fe4924b
- Updated sorting of min/max graphs in the `temp_min_max_avg` graph GH-247
- Added new property for charts: `legendPosition` - Change legend position GH-228
- Added option to set default theme (light/dark/auto) GH-241
+- added per-month statistic tables GH-215
diff --git a/install.py b/install.py
index efdfdace..8ab40330 100644
--- a/install.py
+++ b/install.py
@@ -92,6 +92,7 @@ def __init__(self):
"skins/weewx-wdc/includes/stat-tile.inc",
"skins/weewx-wdc/includes/stat-tile-xaggs.inc",
"skins/weewx-wdc/includes/stat-tile-modals.inc",
+ "skins/weewx-wdc/includes/stat-table.inc",
"skins/weewx-wdc/includes/conditions-table.inc",
"skins/weewx-wdc/includes/climatological-days.inc",
"skins/weewx-wdc/includes/ui-shell.inc",
diff --git a/skins/weewx-wdc/includes/climatological-days.inc b/skins/weewx-wdc/includes/climatological-days.inc
index 6b3ce7bd..9c8c956d 100644
--- a/skins/weewx-wdc/includes/climatological-days.inc
+++ b/skins/weewx-wdc/includes/climatological-days.inc
@@ -1,4 +1,3 @@
-
#errorCatcher Echo
#encoding UTF-8
#from datetime import datetime
@@ -28,7 +27,7 @@
type="module"
src="https://1.www.s81c.com/common/carbon/web-components/version/v1.21.0/tabs.min.js"
>
-
+
- $get_climatological_day_description($clim_day)