Skip to content

Commit

Permalink
Release v4.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
chaunceygardiner committed Jul 4, 2024
1 parent 72c2518 commit c4a5d65
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ Copyright (C)2020-2024 by John A Kline (john@johnkline.com)
`pip install requests`

1. Download the release from the [github](https://github.com/chaunceygardiner/weewx-nws).
Click on releases and pick the latest release (Release v4.2).
Click on releases and pick the latest release (Release v4.3).

1. Install the nws extension.

`weectl extension install weewx-nws-4.2.zip`
`weectl extension install weewx-nws-4.3.zip`

## WeeWX 4 Installation Instructions

Expand All @@ -52,11 +52,11 @@ Copyright (C)2020-2024 by John A Kline (john@johnkline.com)
```

1. Download the release from the [github](https://github.com/chaunceygardiner/weewx-nws).
Click on releases and pick the latest release (Release v4.2).
Click on releases and pick the latest release (Release v4.3).

1. Run the following command.
```
sudo /home/weewx/bin/wee_extension --install weewx-nws-4.2.zip
sudo /home/weewx/bin/wee_extension --install weewx-nws-4.3.zip
```
Note: The above command assumes a WeeWX installation of `/home/weewx`.
Adjust the command as necessary.
Expand Down
10 changes: 8 additions & 2 deletions bin/user/nws.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

log = logging.getLogger(__name__)

WEEWX_NWS_VERSION = "4.2"
WEEWX_NWS_VERSION = "4.3"

if sys.version_info[0] < 3:
raise weewx.UnsupportedFeature(
Expand Down Expand Up @@ -1067,8 +1067,14 @@ def compose_alert_records(j, latitude: str, longitude: str) -> Iterator[Forecast
log.info('found expired alert (skipping): %s' % id)
elif expires <= (time.time() - 24.0 * 60.0 * 60.0): # Don't be so quick to stop showing expired alerts. NWS doesn't reissue them quickly enough.
log.info('alert is past expiration time of %s (skipping): %s' % (timestamp_to_string(expires), alert['id']))
elif alert['status'] == 'Exercise':
log.info("Skipping alert with status of 'Exercise': ID: %s, Description: %s" % (alert['id'], alert['description']))
elif alert['status'] == 'System':
log.info("Skipping alert with status of 'System': ID: %s, Description: %s" % (alert['id'], alert['description']))
elif alert['status'] == 'Test':
log.info("Skipping alert with status of 'Test': ID: %s, Headline: %s" % (alert['id'], alert['headline']))
log.info("Skipping alert with status of 'Test': ID: %s, Description: %s" % (alert['id'], alert['description']))
elif alert['status'] == 'Draft':
log.info("Skipping alert with status of 'Draft': ID: %s, Description: %s" % (alert['id'], alert['description']))
else:
record = Forecast(
interval = NWS.get_interval(ForecastType.ALERTS),
Expand Down
4 changes: 4 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
nws change history
------------------

4.3 07/03/2024
- In addition to ignoring Test alerts, ignore Exercise, System and Draft alerts.
- More formatting changes on the alerts tab of the nws report.

4.2 07/03/2024
- Formatting changes on alerts tab.

Expand Down
2 changes: 1 addition & 1 deletion install.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def loader():
class NWSInstaller(ExtensionInstaller):
def __init__(self):
super(NWSInstaller, self).__init__(
version="4.2",
version="4.3",
name='nws',
description='Fetch NWS Hourly Forecast.',
author="John A Kline",
Expand Down
8 changes: 4 additions & 4 deletions skins/nws/forecast_alerts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@
<td style='text-align:left;'><em>Ends:</em></td>
<td style='text-align:left;'>$alert.ends</td>
</tr>
<tr>
<td style='text-align:left;'><em>Status:</em></td>
<td style='text-align:left;'>&nbsp;$alert.status</td>
</tr>
##x<tr>
##x <td style='text-align:left;'><em>Status:</em></td>
##x <td style='text-align:left;'>&nbsp;$alert.status</td>
##x</tr>
<tr>
<td style='text-align:left;'><em>Severity:</em></td>
<td style='text-align:left;'>&nbsp;$alert.severity</td>
Expand Down
2 changes: 1 addition & 1 deletion skins/nws/skin.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## See LICENSE.txt for your rights

[Extras]
version = 4.2
version = 4.3

[CheetahGenerator]
search_list_extensions = user.nws.NWSForecastVariables
Expand Down

0 comments on commit c4a5d65

Please sign in to comment.