Skip to content

Commit

Permalink
Switch from 5-day to 10-day forecasts
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeethree authored Aug 21, 2023
1 parent 5e9a3cd commit 55b3806
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.0.5
* Switch from 5-day forecasts to 10-day forecasts

v1.0.4
* Fix hourly weather forecast for Home Assistant 2023.8. Thank you @klopyrev!

Expand Down
2 changes: 1 addition & 1 deletion custom_components/weatherdotcom/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
_RESOURCESHARED = '&format=json&apiKey={apiKey}&units={units}'
_RESOURCECURRENT = ('https://api.weather.com/v3/wx/observations/current'
'?geocode={latitude},{longitude}')
_RESOURCEFORECASTDAILY = ('https://api.weather.com/v3/wx/forecast/daily/5day'
_RESOURCEFORECASTDAILY = ('https://api.weather.com/v3/wx/forecast/daily/10day'
'?geocode={latitude},{longitude}')
_RESOURCEFORECASTHOURLY = ('https://api.weather.com/v3/wx/forecast/hourly/2day'
'?geocode={latitude},{longitude}')
Expand Down
2 changes: 1 addition & 1 deletion custom_components/weatherdotcom/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/jaydeethree/Home-Assistant-weatherdotcom/issues/",
"requirements": [],
"version": "1.0.3"
"version": "1.0.5"
}
2 changes: 1 addition & 1 deletion custom_components/weatherdotcom/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ async def async_forecast_daily(self) -> list[Forecast] | None:
@property
def forecast(self) -> list[Forecast]:
"""Return the forecast in native units."""
days = [0, 2, 4, 6, 8]
days = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
if self.coordinator.get_forecast_daily('temperature', 0) is None:
days[0] += 1
caldaytempmax = FIELD_TEMPERATUREMAX
Expand Down

0 comments on commit 55b3806

Please sign in to comment.