Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
liangleslie committed Jan 27, 2024
1 parent f21d23a commit 2275b6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions custom_components/nea_sg_weather/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
DEFAULT_TIMEOUT = 10
HEADERS = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36",
"referer": "https://www.nea.gov.sg",
}
RAIN_MAP_HEADERS = {
"authority": "www.weather.gov.sg",
Expand Down
4 changes: 2 additions & 2 deletions custom_components/nea_sg_weather/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ async def async_forecast_daily(self) -> list[Forecast] | None:
"""Return the daily forecast in native units.
Only implement this method if `WeatherEntityFeature.FORECAST_DAILY` is set
"""
return self.coordinator.data.forecast24hr.forecast
return self.coordinator.data.forecast4day.forecast

async def async_forecast_hourly(self) -> list[Forecast] | None:
"""Return the hourly forecast in native units.
We do not have hourly forecast data so 2 hourly will do
Only implement this method if `WeatherEntityFeature.FORECAST_HOURLY` is set
"""
return self.coordinator.data.forecast2hr.forecast
return self.coordinator.data.forecast2hr.area_forecast

0 comments on commit 2275b6b

Please sign in to comment.