From fa112dfd43d57cc0cbd88d29fb5222797636e32a Mon Sep 17 00:00:00 2001 From: Tom Keffer Date: Sat, 2 May 2020 14:16:18 -0700 Subject: [PATCH] wunderfixer option --test now requires api_key and password. Then goes ahead with querying the WU. --- TODO.md | 7 +++++-- bin/wunderfixer | 15 +++++++++------ docs/changes.txt | 8 +++++--- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/TODO.md b/TODO.md index 8b59798a..a6e0e154 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,9 @@ # To do -Need to add `python3-distutils` to the required package list in `debian/control`. +Should Ultimeter driver actually emit `rain24` and `dayRain`? See +this email thread: https://groups.google.com/forum/#!topic/weewx-user/FM9QANjo1cc # For Version 4.1 -Implement a `$gettext()` extension. \ No newline at end of file +Implement a `$gettext()` extension. + +Be able to add arbitrary lines to graphics. diff --git a/bin/wunderfixer b/bin/wunderfixer index 78cc8405..362a7590 100755 --- a/bin/wunderfixer +++ b/bin/wunderfixer @@ -1,6 +1,6 @@ #!/usr/bin/env python # =============================================================================== -# Copyright (c) 2009-2019 Tom Keffer +# Copyright (c) 2009-2020 Tom Keffer # # This software may be used and redistributed under the # terms of the GNU General Public License version 3.0 @@ -36,6 +36,7 @@ CHANGE HISTORY 1.9.1 05/02/2020 Fixed problem under Python 3 where response was not converted to str before attempting to parse the JSON. +Option --test now requires api_key and password, then goes ahead with querying the WU. 1.9.0 02/10/2020 With response code of 204, changed the default to assume a good station with no data @@ -214,16 +215,16 @@ def main(): try: if not options.station: options.station = config_dict['StdRESTful']['Wunderground']['station'] - if not options.password and not options.simulate: + if not options.password: options.password = config_dict['StdRESTful']['Wunderground']['password'] - if not options.api_key and not options.simulate: + if not options.api_key: options.api_key = config_dict['StdRESTful']['Wunderground']['api_key'] except KeyError: log.error("Missing Wunderground station, password, and/or api_key") exit("Missing Wunderground station, password, and/or api_key") # exit if any essential arguments are not present - if not options.station or (not options.password and not options.api_key and not options.simulate): + if not options.station or not options.password or not options.api_key: print("Missing argument(s).\n") print(parser.parse_args(["--help"])) log.error("Missing argument(s). Wunderfixer exiting.") @@ -232,8 +233,10 @@ def main(): # get our binding and database and say what we are using db_binding = options.binding database = config_dict['DataBindings'][db_binding]['database'] - print("Using database binding '%s', which is bound to database '%s'" % (db_binding, database)) - log.info("Using database binding '%s', which is bound to database '%s'" % (db_binding, database)) + print("Using database binding '%s', which is bound to database '%s'" + % (db_binding, database)) + log.info("Using database binding '%s', which is bound to database '%s'" + % (db_binding, database)) # get the manager object for our db_binding dbmanager_t = weewx.manager.open_manager_with_config(config_dict, db_binding) diff --git a/docs/changes.txt b/docs/changes.txt index a8980482..09ca50e1 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -3,13 +3,15 @@ weewx change history 4.0.1 MM/DD/YYYY -Added a logging handler for rotating files. +Added a logging handler for rotating files. See https://bit.ly/2StYSHb for how +to use it. More information if an exception is raised while querying for vantage hardware type. -Fixed wunderfixer problem under Python 3 where response was not converted to -str before attempting to parse the JSON. +wunderfixer: fixed problem under Python 3 where response was not converted to +str before attempting to parse the JSON. Option --simulate now requires api_key +and password, so it can hit the WU. Fixed problem in te923 driver under Python 3 that caused it to crash.