From e4d6ac7c8fcda86b1ff17dd70d8a2c7cb04971e6 Mon Sep 17 00:00:00 2001 From: Tom Keffer Date: Fri, 29 Jan 2021 15:51:20 -0800 Subject: [PATCH] Fixed problem introduced by PR #630. --- bin/weewx/wxservices.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/weewx/wxservices.py b/bin/weewx/wxservices.py index 99543028..36127879 100644 --- a/bin/weewx/wxservices.py +++ b/bin/weewx/wxservices.py @@ -76,6 +76,8 @@ class StdWXCalculate(weewx.engine.StdService): self.archive_calc_dict.setdefault('windDir', 'software') self.loop_calc_dict.setdefault('windGustDir', 'software') self.archive_calc_dict.setdefault('windGustDir', 'software') + # For backwards compatibility: + self.calc_dict = self.archive_calc_dict if weewx.debug > 1: log.debug("Calculations for LOOP packets: %s", self.loop_calc_dict) @@ -98,13 +100,16 @@ class StdWXCalculate(weewx.engine.StdService): def new_archive_record(self, event): self.do_calculations(event.record, self.archive_calc_dict) - def do_calculations(self, data_dict, calc_dict): + def do_calculations(self, data_dict, calc_dict=None): """Augment the data dictionary with derived types as necessary. data_dict: The incoming LOOP packet or archive record. calc_dict: the directives to apply """ + if calc_dict is None: + calc_dict = self.archive_calc_dict + # Go through the list of potential calculations and see which ones need to be done for obs in calc_dict: directive = calc_dict[obs]