From 55b3806823c891df8d5428b74798e50000a38357 Mon Sep 17 00:00:00 2001 From: jaydeethree <34945248+jaydeethree@users.noreply.github.com> Date: Mon, 21 Aug 2023 10:35:18 -0700 Subject: [PATCH] Switch from 5-day to 10-day forecasts --- CHANGELOG.md | 3 +++ custom_components/weatherdotcom/coordinator.py | 2 +- custom_components/weatherdotcom/manifest.json | 2 +- custom_components/weatherdotcom/weather.py | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b7d40f..63f4dd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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! diff --git a/custom_components/weatherdotcom/coordinator.py b/custom_components/weatherdotcom/coordinator.py index 21996be..81648e8 100644 --- a/custom_components/weatherdotcom/coordinator.py +++ b/custom_components/weatherdotcom/coordinator.py @@ -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}') diff --git a/custom_components/weatherdotcom/manifest.json b/custom_components/weatherdotcom/manifest.json index 9845eca..e0de02b 100644 --- a/custom_components/weatherdotcom/manifest.json +++ b/custom_components/weatherdotcom/manifest.json @@ -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" } diff --git a/custom_components/weatherdotcom/weather.py b/custom_components/weatherdotcom/weather.py index 55057e4..deca3a3 100644 --- a/custom_components/weatherdotcom/weather.py +++ b/custom_components/weatherdotcom/weather.py @@ -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