From 211f9bfcd1ae18a6d8a18f09a0eecfbabbf1f42a Mon Sep 17 00:00:00 2001 From: Tom Keffer Date: Thu, 29 Feb 2024 11:29:36 -0800 Subject: [PATCH 1/5] Do not include [Station] when installing extension Including it causes the section to be deleted if the extension is uninstalled. --- install.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/install.py b/install.py index d97e651..f202f5d 100644 --- a/install.py +++ b/install.py @@ -34,15 +34,6 @@ def loader(): WLL_CONFIG = """ -[Station] - # This section is for information about the station. - - # Set to type of station hardware. There must be a corresponding stanza - # in this file, which includes a value for the 'driver' option. - station_type = WeatherLinkLive - -############################################################################## - [WeatherLinkLive] # This section configures the WeatherLink Live driver. From 3e7cf7d05f3c99e9bf4726709bab1a76c0793177 Mon Sep 17 00:00:00 2001 From: Michael Schantl Date: Fri, 1 Mar 2024 08:59:20 +0100 Subject: [PATCH 2/5] Fix type-hinting of existing options dict in cfg editor --- bin/user/weatherlink_live/config_editor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/user/weatherlink_live/config_editor.py b/bin/user/weatherlink_live/config_editor.py index b678b33..da28059 100644 --- a/bin/user/weatherlink_live/config_editor.py +++ b/bin/user/weatherlink_live/config_editor.py @@ -18,7 +18,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from typing import Any, Dict, Tuple, List, Optional +from typing import Any, Dict, Tuple, List, Optional, Union import weecfg import weewx.drivers @@ -124,6 +124,8 @@ def _print_schema_info(): class WeatherlinkLiveConfEditor(weewx.drivers.AbstractConfEditor): + existing_options: Dict[str, Optional[Union[str, List[str]]]] + def __init__(self): self.existing_options = dict() From dbdaf383244b9901810a6c5831782ce37e15257c Mon Sep 17 00:00:00 2001 From: Michael Schantl Date: Fri, 1 Mar 2024 09:06:22 +0100 Subject: [PATCH 3/5] Fix typing compat issues with Python < 3.9 Python < 3.9 does not support generic `list` type. --- bin/user/weatherlink_live/mappers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/user/weatherlink_live/mappers.py b/bin/user/weatherlink_live/mappers.py index 87ee0f8..b16e133 100644 --- a/bin/user/weatherlink_live/mappers.py +++ b/bin/user/weatherlink_live/mappers.py @@ -134,7 +134,7 @@ def map_source_transmitter(self) -> str: raise NotImplementedError() @property - def map_table(self) -> Dict[str, Union[str, list[str]]]: + def map_table(self) -> Dict[str, Union[str, List[str]]]: raise NotImplementedError() @@ -476,7 +476,7 @@ def map_source_transmitter(self) -> str: return labels.LABEL_SOURCE_TX_ID % self.tx_id @property - def map_table(self) -> Dict[str, list[str]]: + def map_table(self) -> Dict[str, List[str]]: return { labels.LABEL_THW_INDEX: [self.targets['thw'], self.targets['app_temp']] if self.is_app_temp else [ self.targets['thw']], @@ -517,7 +517,7 @@ def map_source_transmitter(self) -> str: return labels.LABEL_SOURCE_TX_ID % self.tx_id @property - def map_table(self) -> Dict[str, list[str]]: + def map_table(self) -> Dict[str, List[str]]: return { labels.LABEL_THSW_INDEX: [self.targets['thsw'], self.targets['app_temp']] if self.is_app_temp else [ self.targets['thsw']], @@ -723,7 +723,7 @@ def map_source_transmitter(self) -> str: return labels.LABEL_SOURCE_TX_ID % self.tx_id @property - def map_table(self) -> Dict[str, list[str]]: + def map_table(self) -> Dict[str, List[str]]: return { labels.LABEL_BATTERY_STATUS: [self.targets['battery'], *self.further_targets], } From 6732ed35aa687687c27c3e64cd3c3925b3d57baa Mon Sep 17 00:00:00 2001 From: Michael Schantl Date: Fri, 1 Mar 2024 11:43:12 +0100 Subject: [PATCH 4/5] Bump version to 1.1.4 --- bin/user/weatherlink_live/static/version.py | 2 +- docs/installation.md | 2 +- install.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/user/weatherlink_live/static/version.py b/bin/user/weatherlink_live/static/version.py index c85f093..43c6a08 100644 --- a/bin/user/weatherlink_live/static/version.py +++ b/bin/user/weatherlink_live/static/version.py @@ -20,4 +20,4 @@ DRIVER_NAME = "WeatherLinkLive" -DRIVER_VERSION = "1.1.3" +DRIVER_VERSION = "1.1.4" diff --git a/docs/installation.md b/docs/installation.md index bc455f0..683968a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -32,7 +32,7 @@ If you haven't done so already, install the following packages: 1. Install the extension by running the following command, possibly using `sudo`. ```sh -> weectl extension install https://github.com/michael-slx/weewx-weatherlink-live/releases/download/v1.1.3/weewx-weatherlink-live-v1.1.3.tar.xz +> weectl extension install https://github.com/michael-slx/weewx-weatherlink-live/releases/download/v1.1.4/weewx-weatherlink-live-v1.1.4.tar.xz ``` Answer `y` (Yes), when asked if you want to install the extension. diff --git a/install.py b/install.py index f202f5d..404bb1f 100644 --- a/install.py +++ b/install.py @@ -68,7 +68,7 @@ class WeatherLinkLiveInstaller(ExtensionInstaller): def __init__(self): super(WeatherLinkLiveInstaller, self).__init__( name='weatherlink-live', - version="1.1.3", + version="1.1.4", description='WeeWX driver for Davis WeatherLink Live.', author="Michael Schantl", author_email="floss@schantl-lx.at", From babfb520dddb1a3aa9efc7d82624311789aa918c Mon Sep 17 00:00:00 2001 From: Michael Schantl Date: Fri, 1 Mar 2024 12:06:33 +0100 Subject: [PATCH 5/5] Update changelog --- changes.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/changes.md b/changes.md index a47a14e..a443cd5 100644 --- a/changes.md +++ b/changes.md @@ -201,3 +201,15 @@ Driver is now compatible with **Python 3.7 or later**. The snippet contains sensible defaults for a WeatherLink Live with a standard Vantage Pro II Plus. +## Version 1.1.4 + +- **Remove `[Station]` section from installer example config** ([PR #39](https://github.com/michael-slx/weewx-weatherlink-live/pull/39)) + + Specifying this section in the example config caused it to be removed when the extension was uninstalled, breaking the whole configuration file. + + Thanks to user [tkeffer](https://github.com/tkeffer) for submitting the pull request. + +- **Fix type-hinting issue and compatibility problems** + + WeeWX supports Python 3.7 but some type-hinting used by this driver required at least Python 3.9. This was fixed so that the driver now works with Python 3.7. +