-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add forecast service call for extra attributes for nws #32729
Changes from all commits
920f186
72b3963
ac6c863
b3ff84c
13c6707
b0dda99
495c977
7ca8bd0
8980b7f
b6a3369
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -26,8 +26,36 @@ According to the [API documentation](https://www.weather.gov/documentation/servi | |||||||||
|
||||||||||
Providing a METAR station code is optional, and if not supplied, the closest station to the latitude and longitude will be chosen. A list of nearby stations is printed to the log with level `DEBUG` if no station is supplied. Stations can also be found on the [NOAA website](https://www.cnrfc.noaa.gov/metar.php). Codes with only three characters, for example, `ADW` should be prefixed with the letter K, `KADW`. | ||||||||||
|
||||||||||
One weather entity is created for each entry in the configuration. Hourly and day/night forecasts are provided through the `weather.get_forecasts` action. The time supplied for each forecast is the start time for the forecast. Sensors are also created as disabled entities after configuration and can be enabled by the user. | ||||||||||
One weather entity is created for each entry in the configuration. Hourly and day/night forecasts are provided through the [`weather.get_forecasts` action](/integrations/weather/action--weatherget_forecasts). The time supplied for each forecast is the start time for the forecast. Sensors are also created as disabled entities after configuration and can be enabled by the user. | ||||||||||
|
||||||||||
Details about the API are available in the [NWS API documentation](https://www.weather.gov/documentation/services-web-api). The [pynws](https://github.com/MatthewFlamm/pynws) library is used to retrieve data. | ||||||||||
## Action `nws.get_forecasts_extra` | ||||||||||
|
||||||||||
`nws.get_forecasts_extra` provides extra data in a form similar to `weather.get_forecasts`. See [`weather.get_forecasts` documentation](/integrations/weather/action--weatherget_forecasts). | ||||||||||
|
||||||||||
| Data attribute | Optional | Description | Example | | ||||||||||
| ---------------------- | -------- | ----------- | --------| | ||||||||||
| `type` | no | The type of forecast, must be either `twice_daily` or `hourly`. | `twice_daily` | | ||||||||||
Comment on lines
+35
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix table formatting and improve attribute description. The table rows are missing trailing pipes, and the description for the | Data attribute | Optional | Description | Example |
| ---------------------- | -------- | ----------- | --------|
| `type` | no | The type of forecast, must be either `twice_daily` or `hourly`. | `twice_daily` |
|
||||||||||
|
||||||||||
```yaml | ||||||||||
service: nws.get_forecasts_extra | ||||||||||
target: | ||||||||||
entity_id: | ||||||||||
- weather.khou | ||||||||||
data: | ||||||||||
type: twice_daily | ||||||||||
response_variable: weather_forecast | ||||||||||
``` | ||||||||||
|
||||||||||
Details about the `weather.get_forecasts` action are available in the [`weather` documentation](/integrations/weather/). | ||||||||||
The response data field is a mapping of called target entities, each containing the `forecast` field. | ||||||||||
`forecast` is a list of forecasted conditions at a given point in time that are not returned from `weather.get_forecasts`. The `datetime` and `is_daytime` attributes are still provided for context. | ||||||||||
Comment on lines
+49
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix redundancy in the description. The phrase "at a given point in time" is redundant. - `forecast` is a list of forecasted conditions at a given point in time that are not returned from `weather.get_forecasts`.
+ `forecast` is a list of forecasted conditions at a point in time that are not returned from `weather.get_forecasts`. Committable suggestion
Suggested change
ToolsLanguageTool
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The phrasing "forecast is a list of forecasted conditions at a given point in time" is mirrored from the parent weather.get_forecasts action. This language should be kept consistent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MatthewFlamm Thank you for pointing out the importance of maintaining consistency with the Analysis chainScripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for the `weather.get_forecasts` action documentation to verify the phrasing.
rg "weather.get_forecasts" -A 10
Length of output: 9388 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MatthewFlamm Thank you for the clarification. I agree that if the |
||||||||||
|
||||||||||
| Response data | Description | Example | | ||||||||||
| ---------------------- | ----------- | -------- | | ||||||||||
| `datetime` | The time of the forecasted conditions. | 2023-02-17T14:00:00+00:00 | | ||||||||||
| `is_daytime` | Only set for `twice_daily` forecasts. | True | | ||||||||||
| `detailed_description` | Only set for `twice_daily` forecasts. | 50% Chance of rain, otherwise partly cloudy with a high of 75F. | | ||||||||||
| `short_description` | Short weather condition | Partly Sunny then Slight Chance Showers And Thunderstorms | | ||||||||||
Comment on lines
+52
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix table formatting and remove redundancy in description. The table rows are missing trailing pipes, and the description of the | Response data | Description | Example |
| ---------------------- | ----------- | -------- |
| `datetime` | The time of the forecasted conditions. | 2023-02-17T14:00:00+00:00 |
| `is_daytime` | Only set for `twice_daily` forecasts. | True |
| `detailed_description` | Only set for `twice_daily` forecasts. | 50% Chance of rain, otherwise partly cloudy with a high of 75F. |
| `short_description` | Short weather condition | Partly Sunny then Slight Chance Showers And Thunderstorms | Additionally, update the description to remove redundancy: -`forecast` is a list of forecasted conditions at a given point in time that are not returned from `weather.get_forecasts`. The `datetime` and `is_daytime` attributes are still provided for context.
+`forecast` is a list of forecasted conditions at a point in time that are not returned from `weather.get_forecasts`. The `datetime` and `is_daytime` attributes are still provided for context. ToolsLanguageTool
|
||||||||||
|
||||||||||
## Details | ||||||||||
|
||||||||||
Details about the API are available in the [NWS API documentation](https://www.weather.gov/documentation/services-web-api). The [pynws](https://github.com/MatthewFlamm/pynws) library is used to retrieve data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix trailing spaces and align terminology.
Remove trailing spaces and align the terminology with the rest of the document.
Committable suggestion
Tools
Markdownlint