Fix missing dew point and humidity in tomorrowio forecasts (#99793)

* Fix missing dew point and humidity in tomorrowio forecasts

* Add assertion for correct parameters to realtime_and_all_forecasts method
This commit is contained in:
lymanepp 2023-09-07 22:12:18 -04:00 committed by GitHub
parent 432894a401
commit b76ba002e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 60 additions and 1 deletions

View File

@ -302,6 +302,8 @@ class TomorrowioDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
[
TMRW_ATTR_TEMPERATURE_LOW,
TMRW_ATTR_TEMPERATURE_HIGH,
TMRW_ATTR_DEW_POINT,
TMRW_ATTR_HUMIDITY,
TMRW_ATTR_WIND_SPEED,
TMRW_ATTR_WIND_DIRECTION,
TMRW_ATTR_CONDITION,

View File

@ -153,9 +153,66 @@ async def test_legacy_config_entry(hass: HomeAssistant) -> None:
assert len(er.async_entries_for_config_entry(registry, entry.entry_id)) == 30
async def test_v4_weather(hass: HomeAssistant) -> None:
async def test_v4_weather(hass: HomeAssistant, tomorrowio_config_entry_update) -> None:
"""Test v4 weather data."""
weather_state = await _setup(hass, API_V4_ENTRY_DATA)
tomorrowio_config_entry_update.assert_called_with(
[
"temperature",
"humidity",
"pressureSeaLevel",
"windSpeed",
"windDirection",
"weatherCode",
"visibility",
"pollutantO3",
"windGust",
"cloudCover",
"precipitationType",
"pollutantCO",
"mepIndex",
"mepHealthConcern",
"mepPrimaryPollutant",
"cloudBase",
"cloudCeiling",
"cloudCover",
"dewPoint",
"epaIndex",
"epaHealthConcern",
"epaPrimaryPollutant",
"temperatureApparent",
"fireIndex",
"pollutantNO2",
"pollutantO3",
"particulateMatter10",
"particulateMatter25",
"grassIndex",
"treeIndex",
"weedIndex",
"precipitationType",
"pressureSurfaceLevel",
"solarGHI",
"pollutantSO2",
"uvIndex",
"uvHealthConcern",
"windGust",
],
[
"temperatureMin",
"temperatureMax",
"dewPoint",
"humidity",
"windSpeed",
"windDirection",
"weatherCode",
"precipitationIntensityAvg",
"precipitationProbability",
],
nowcast_timestep=60,
location="80.0,80.0",
)
assert weather_state.state == ATTR_CONDITION_SUNNY
assert weather_state.attributes[ATTR_ATTRIBUTION] == ATTRIBUTION
assert len(weather_state.attributes[ATTR_FORECAST]) == 14